@@ -24,12 +24,14 @@ class remove_instanceoft
2424{
2525public:
2626 remove_instanceoft (
27- symbol_table_baset &symbol_table, message_handlert &message_handler)
27+ symbol_table_baset &symbol_table,
28+ const class_hierarchyt &class_hierarchy,
29+ message_handlert &message_handler)
2830 : symbol_table(symbol_table)
31+ , class_hierarchy(class_hierarchy)
2932 , ns(symbol_table)
3033 , message_handler(message_handler)
3134 {
32- class_hierarchy (symbol_table);
3335 }
3436
3537 // Lower instanceof for a single function
@@ -40,8 +42,8 @@ class remove_instanceoft
4042
4143protected:
4244 symbol_table_baset &symbol_table;
45+ const class_hierarchyt &class_hierarchy;
4346 namespacet ns;
44- class_hierarchyt class_hierarchy;
4547 message_handlert &message_handler;
4648
4749 bool lower_instanceof (
@@ -240,14 +242,16 @@ bool remove_instanceoft::lower_instanceof(goto_programt &goto_program)
240242// / \param target: The instruction to work on.
241243// / \param goto_program: The function body containing the instruction.
242244// / \param symbol_table: The symbol table to add symbols to.
245+ // / \param class_hierarchy: class hierarchy analysis of symbol_table
243246// / \param message_handler: logging output
244247void remove_instanceof (
245248 goto_programt::targett target,
246249 goto_programt &goto_program,
247250 symbol_table_baset &symbol_table,
251+ const class_hierarchyt &class_hierarchy,
248252 message_handlert &message_handler)
249253{
250- remove_instanceoft rem (symbol_table, message_handler);
254+ remove_instanceoft rem (symbol_table, class_hierarchy, message_handler);
251255 rem.lower_instanceof (goto_program, target);
252256}
253257
@@ -256,13 +260,15 @@ void remove_instanceof(
256260// / \remarks Extra auxiliary variables may be introduced into symbol_table.
257261// / \param function: The function to work on.
258262// / \param symbol_table: The symbol table to add symbols to.
263+ // / \param class_hierarchy: class hierarchy analysis of symbol_table
259264// / \param message_handler: logging output
260265void remove_instanceof (
261266 goto_functionst::goto_functiont &function,
262267 symbol_table_baset &symbol_table,
268+ const class_hierarchyt &class_hierarchy,
263269 message_handlert &message_handler)
264270{
265- remove_instanceoft rem (symbol_table, message_handler);
271+ remove_instanceoft rem (symbol_table, class_hierarchy, message_handler);
266272 rem.lower_instanceof (function.body );
267273}
268274
@@ -271,13 +277,15 @@ void remove_instanceof(
271277// / \remarks Extra auxiliary variables may be introduced into symbol_table.
272278// / \param goto_functions: The functions to work on.
273279// / \param symbol_table: The symbol table to add symbols to.
280+ // / \param class_hierarchy: class hierarchy analysis of symbol_table
274281// / \param message_handler: logging output
275282void remove_instanceof (
276283 goto_functionst &goto_functions,
277284 symbol_table_baset &symbol_table,
285+ const class_hierarchyt &class_hierarchy,
278286 message_handlert &message_handler)
279287{
280- remove_instanceoft rem (symbol_table, message_handler);
288+ remove_instanceoft rem (symbol_table, class_hierarchy, message_handler);
281289 bool changed=false ;
282290 for (auto &f : goto_functions.function_map )
283291 changed=rem.lower_instanceof (f.second .body ) || changed;
@@ -289,12 +297,18 @@ void remove_instanceof(
289297// / class-identifier test.
290298// / \remarks Extra auxiliary variables may be introduced into symbol_table.
291299// / \param goto_model: The functions to work on and the symbol table to add
300+ // / \param class_hierarchy: class hierarchy analysis of goto_model's symbol
301+ // / table
292302// / \param message_handler: logging output
293303// / symbols to.
294304void remove_instanceof (
295305 goto_modelt &goto_model,
306+ const class_hierarchyt &class_hierarchy,
296307 message_handlert &message_handler)
297308{
298309 remove_instanceof (
299- goto_model.goto_functions , goto_model.symbol_table , message_handler);
310+ goto_model.goto_functions ,
311+ goto_model.symbol_table ,
312+ class_hierarchy,
313+ message_handler);
300314}
0 commit comments