File tree 3 files changed +29
-6
lines changed
3 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,11 @@ class lazy_goto_functions_mapt final
120
120
121
121
void unload (const key_type &name) const { goto_functions.erase (name); }
122
122
123
+ void ensure_function_loaded (const key_type &name) const
124
+ {
125
+ ensure_function_loaded_internal (name);
126
+ }
127
+
123
128
private:
124
129
// This returns a non-const reference, but if you use this method from a
125
130
// const method then you should not return such a reference without making it
Original file line number Diff line number Diff line change 11
11
12
12
#include < util/cmdline.h>
13
13
#include < util/config.h>
14
+ #include < util/journalling_symbol_table.h>
14
15
#include < util/language.h>
15
16
#include < util/unicode.h>
16
17
@@ -184,12 +185,6 @@ void lazy_goto_modelt::initialize(const cmdlinet &cmdline)
184
185
throw 0 ;
185
186
}
186
187
187
- if (language_files.final (symbol_table))
188
- {
189
- msg.error () << " FINAL STAGE CONVERSION ERROR" << messaget::eom;
190
- throw 0 ;
191
- }
192
-
193
188
// stupid hack
194
189
config.set_object_bits_from_symbol_table (symbol_table);
195
190
}
@@ -203,6 +198,24 @@ void lazy_goto_modelt::load_all_functions() const
203
198
204
199
bool lazy_goto_modelt::finalize ()
205
200
{
201
+ messaget msg (message_handler);
202
+ journalling_symbol_tablet symbol_table=
203
+ journalling_symbol_tablet::wrap (this ->symbol_table );
204
+ if (language_files.final (symbol_table))
205
+ {
206
+ msg.error () << " CONVERSION ERROR" << messaget::eom;
207
+ return true ;
208
+ }
209
+ for (const irep_idt &updated_symbol_id : symbol_table.get_updated ())
210
+ {
211
+ if (symbol_table.lookup_ref (updated_symbol_id).is_function ())
212
+ {
213
+ // Re-convert any that already exist
214
+ goto_functions.unload (updated_symbol_id);
215
+ goto_functions.ensure_function_loaded (updated_symbol_id);
216
+ }
217
+ }
218
+
206
219
language_files.clear ();
207
220
208
221
return post_process_functions (*goto_model);
Original file line number Diff line number Diff line change @@ -109,6 +109,11 @@ class symbolt
109
109
{
110
110
return !is_static_lifetime;
111
111
}
112
+
113
+ bool is_function () const
114
+ {
115
+ return !is_type && !is_macro && type.id ()==ID_code;
116
+ }
112
117
};
113
118
114
119
std::ostream &operator <<(std::ostream &out, const symbolt &symbol);
You can’t perform that action at this time.
0 commit comments