@@ -24,8 +24,7 @@ class remove_virtual_functionst
2424{
2525public:
2626 remove_virtual_functionst (
27- const symbol_tablet &_symbol_table,
28- const goto_functionst &goto_functions);
27+ const symbol_tablet &_symbol_table);
2928
3029 void operator ()(goto_functionst &goto_functions);
3130
@@ -65,8 +64,7 @@ class remove_virtual_functionst
6564};
6665
6766remove_virtual_functionst::remove_virtual_functionst (
68- const symbol_tablet &_symbol_table,
69- const goto_functionst &goto_functions):
67+ const symbol_tablet &_symbol_table):
7068 ns(_symbol_table),
7169 symbol_table(_symbol_table)
7270{
@@ -436,9 +434,7 @@ void remove_virtual_functions(
436434 const symbol_tablet &symbol_table,
437435 goto_functionst &goto_functions)
438436{
439- remove_virtual_functionst
440- rvf (symbol_table, goto_functions);
441-
437+ remove_virtual_functionst rvf (symbol_table);
442438 rvf (goto_functions);
443439}
444440
@@ -448,15 +444,24 @@ void remove_virtual_functions(goto_modelt &goto_model)
448444 goto_model.symbol_table , goto_model.goto_functions );
449445}
450446
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+
451457void remove_virtual_function (
452458 goto_modelt &goto_model,
453459 goto_programt &goto_program,
454460 goto_programt::targett instruction,
455461 const dispatch_table_entriest &dispatch_table,
456462 virtual_dispatch_fallback_actiont fallback_action)
457463{
458- remove_virtual_functionst
459- rvf (goto_model.symbol_table , goto_model.goto_functions );
464+ remove_virtual_functionst rvf (goto_model.symbol_table );
460465
461466 rvf.remove_virtual_function (
462467 goto_program, instruction, dispatch_table, fallback_action);
0 commit comments