@@ -28,16 +28,17 @@ class remove_instanceoft
28
28
class_hierarchy (symbol_table);
29
29
}
30
30
31
- // Lower instanceof for a single functions
31
+ // Lower instanceof for a single function
32
32
bool lower_instanceof (goto_programt &);
33
33
34
+ // Lower instanceof for a single instruction
35
+ bool lower_instanceof (goto_programt &, goto_programt::targett);
36
+
34
37
protected:
35
38
symbol_tablet &symbol_table;
36
39
namespacet ns;
37
40
class_hierarchyt class_hierarchy;
38
41
39
- bool lower_instanceof (goto_programt &, goto_programt::targett);
40
-
41
42
std::size_t lower_instanceof (
42
43
exprt &, goto_programt &, goto_programt::targett);
43
44
};
@@ -168,9 +169,24 @@ bool remove_instanceoft::lower_instanceof(goto_programt &goto_program)
168
169
}
169
170
170
171
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
+
171
187
// / Replace every instanceof in the passed function with an explicit
172
188
// / class-identifier test.
173
- // / Extra auxiliary variables may be introduced into symbol_table.
189
+ // / \remarks Extra auxiliary variables may be introduced into symbol_table.
174
190
// / \param function: The function to work on.
175
191
// / \param symbol_table: The symbol table to add symbols to.
176
192
void remove_instanceof (
@@ -183,7 +199,7 @@ void remove_instanceof(
183
199
184
200
// / Replace every instanceof in every function with an explicit
185
201
// / class-identifier test.
186
- // / Extra auxiliary variables may be introduced into symbol_table.
202
+ // / \remarks Extra auxiliary variables may be introduced into symbol_table.
187
203
// / \param goto_functions: The functions to work on.
188
204
// / \param symbol_table: The symbol table to add symbols to.
189
205
void remove_instanceof (
@@ -198,6 +214,11 @@ void remove_instanceof(
198
214
goto_functions.compute_location_numbers ();
199
215
}
200
216
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.
201
222
void remove_instanceof (goto_modelt &goto_model)
202
223
{
203
224
remove_instanceof (goto_model.goto_functions , goto_model.symbol_table );
0 commit comments