@@ -24,8 +24,7 @@ class remove_virtual_functionst
24
24
{
25
25
public:
26
26
remove_virtual_functionst (
27
- const symbol_tablet &_symbol_table,
28
- const goto_functionst &goto_functions);
27
+ const symbol_tablet &_symbol_table);
29
28
30
29
void operator ()(goto_functionst &goto_functions);
31
30
@@ -65,8 +64,7 @@ class remove_virtual_functionst
65
64
};
66
65
67
66
remove_virtual_functionst::remove_virtual_functionst (
68
- const symbol_tablet &_symbol_table,
69
- const goto_functionst &goto_functions):
67
+ const symbol_tablet &_symbol_table):
70
68
ns(_symbol_table),
71
69
symbol_table(_symbol_table)
72
70
{
@@ -436,9 +434,7 @@ void remove_virtual_functions(
436
434
const symbol_tablet &symbol_table,
437
435
goto_functionst &goto_functions)
438
436
{
439
- remove_virtual_functionst
440
- rvf (symbol_table, goto_functions);
441
-
437
+ remove_virtual_functionst rvf (symbol_table);
442
438
rvf (goto_functions);
443
439
}
444
440
@@ -448,15 +444,24 @@ void remove_virtual_functions(goto_modelt &goto_model)
448
444
goto_model.symbol_table , goto_model.goto_functions );
449
445
}
450
446
447
+ void remove_virtual_functions (goto_model_functiont &function)
448
+ {
449
+ remove_virtual_functionst rvf (function.get_symbol_table ());
450
+ bool changed = rvf.remove_virtual_functions (
451
+ function.get_goto_function ().body );
452
+ // Give fresh location numbers to `function`, in case it has grown:
453
+ if (changed)
454
+ function.compute_location_numbers ();
455
+ }
456
+
451
457
void remove_virtual_function (
452
458
goto_modelt &goto_model,
453
459
goto_programt &goto_program,
454
460
goto_programt::targett instruction,
455
461
const dispatch_table_entriest &dispatch_table,
456
462
virtual_dispatch_fallback_actiont fallback_action)
457
463
{
458
- remove_virtual_functionst
459
- rvf (goto_model.symbol_table , goto_model.goto_functions );
464
+ remove_virtual_functionst rvf (goto_model.symbol_table );
460
465
461
466
rvf.remove_virtual_function (
462
467
goto_program, instruction, dispatch_table, fallback_action);
0 commit comments