@@ -76,13 +76,6 @@ class remove_virtual_functionst
76
76
const irep_idt &function_id,
77
77
goto_programt &goto_program);
78
78
79
- goto_programt::targett remove_virtual_function (
80
- const irep_idt &function_id,
81
- goto_programt &goto_program,
82
- goto_programt::targett target,
83
- const dispatch_table_entriest &functions,
84
- virtual_dispatch_fallback_actiont fallback_action);
85
-
86
79
private:
87
80
const class_hierarchyt &class_hierarchy;
88
81
symbol_table_baset &symbol_table;
@@ -249,6 +242,7 @@ static void process_this_argument(
249
242
// / implementation. If there's a type mismatch between implementation
250
243
// / and the instance type or if fallback_action is set to
251
244
// / ASSUME_FALSE, then function is substituted with a call to ASSUME(false)
245
+ // / \param symbol_table: Symbol table associated with \p goto_program
252
246
// / \param function_id: The identifier of the function we are currently
253
247
// / analysing
254
248
// / \param [in,out] goto_program: GOTO program to modify
@@ -261,7 +255,8 @@ static void process_this_argument(
261
255
// / with the most derived matching call
262
256
// / \return Returns a pointer to the statement in the supplied GOTO
263
257
// / program after replaced function call
264
- goto_programt::targett remove_virtual_functionst::remove_virtual_function (
258
+ static goto_programt::targett replace_virtual_function_with_dispatch_table (
259
+ symbol_table_baset &symbol_table,
265
260
const irep_idt &function_id,
266
261
goto_programt &goto_program,
267
262
goto_programt::targett target,
@@ -272,6 +267,7 @@ goto_programt::targett remove_virtual_functionst::remove_virtual_function(
272
267
target->is_function_call (),
273
268
" remove_virtual_function must target a FUNCTION_CALL instruction" );
274
269
270
+ namespacet ns (symbol_table);
275
271
goto_programt::targett next_target = std::next (target);
276
272
277
273
if (functions.empty ())
@@ -491,7 +487,8 @@ goto_programt::targett remove_virtual_functionst::remove_virtual_function(
491
487
dispatch_table_entriest functions;
492
488
get_callees.get_functions (function, functions);
493
489
494
- return remove_virtual_function (
490
+ return replace_virtual_function_with_dispatch_table (
491
+ symbol_table,
495
492
function_id,
496
493
goto_program,
497
494
target,
@@ -793,12 +790,13 @@ goto_programt::targett remove_virtual_function(
793
790
const dispatch_table_entriest &dispatch_table,
794
791
virtual_dispatch_fallback_actiont fallback_action)
795
792
{
796
- class_hierarchyt class_hierarchy;
797
- class_hierarchy (symbol_table);
798
- remove_virtual_functionst rvf (symbol_table, class_hierarchy);
799
-
800
- goto_programt::targett next = rvf.remove_virtual_function (
801
- function_id, goto_program, instruction, dispatch_table, fallback_action);
793
+ goto_programt::targett next = replace_virtual_function_with_dispatch_table (
794
+ symbol_table,
795
+ function_id,
796
+ goto_program,
797
+ instruction,
798
+ dispatch_table,
799
+ fallback_action);
802
800
803
801
goto_program.update ();
804
802
0 commit comments