@@ -28,16 +28,17 @@ class remove_instanceoft
2828 class_hierarchy (symbol_table);
2929 }
3030
31- // Lower instanceof for a single functions
31+ // Lower instanceof for a single function
3232 bool lower_instanceof (goto_programt &);
3333
34+ // Lower instanceof for a single instruction
35+ bool lower_instanceof (goto_programt &, goto_programt::targett);
36+
3437protected:
3538 symbol_tablet &symbol_table;
3639 namespacet ns;
3740 class_hierarchyt class_hierarchy;
3841
39- bool lower_instanceof (goto_programt &, goto_programt::targett);
40-
4142 std::size_t lower_instanceof (
4243 exprt &, goto_programt &, goto_programt::targett);
4344};
@@ -168,9 +169,24 @@ bool remove_instanceoft::lower_instanceof(goto_programt &goto_program)
168169}
169170
170171
172+ // / Replace an instanceof in the expression or guard of the passed instruction
173+ // / of the given function body with an explicit class-identifier test.
174+ // / \remarks Extra auxiliary variables may be introduced into symbol_table.
175+ // / \param target: The instruction to work on.
176+ // / \param goto_program: The function body containing the instruction.
177+ // / \param symbol_table: The symbol table to add symbols to.
178+ void remove_instanceof (
179+ goto_programt::targett target,
180+ goto_programt &goto_program,
181+ symbol_tablet &symbol_table)
182+ {
183+ remove_instanceoft rem (symbol_table);
184+ rem.lower_instanceof (goto_program, target);
185+ }
186+
171187// / Replace every instanceof in the passed function with an explicit
172188// / class-identifier test.
173- // / Extra auxiliary variables may be introduced into symbol_table.
189+ // / \remarks Extra auxiliary variables may be introduced into symbol_table.
174190// / \param function: The function to work on.
175191// / \param symbol_table: The symbol table to add symbols to.
176192void remove_instanceof (
@@ -183,7 +199,7 @@ void remove_instanceof(
183199
184200// / Replace every instanceof in every function with an explicit
185201// / class-identifier test.
186- // / Extra auxiliary variables may be introduced into symbol_table.
202+ // / \remarks Extra auxiliary variables may be introduced into symbol_table.
187203// / \param goto_functions: The functions to work on.
188204// / \param symbol_table: The symbol table to add symbols to.
189205void remove_instanceof (
@@ -198,6 +214,11 @@ void remove_instanceof(
198214 goto_functions.compute_location_numbers ();
199215}
200216
217+ // / Replace every instanceof in every function with an explicit
218+ // / class-identifier test.
219+ // / \remarks Extra auxiliary variables may be introduced into symbol_table.
220+ // / \param goto_model: The functions to work on and the symbol table to add
221+ // / symbols to.
201222void remove_instanceof (goto_modelt &goto_model)
202223{
203224 remove_instanceof (goto_model.goto_functions , goto_model.symbol_table );
0 commit comments