@@ -24,7 +24,8 @@ class remove_virtual_functionst
24
24
{
25
25
public:
26
26
remove_virtual_functionst (
27
- const symbol_table_baset &_symbol_table);
27
+ const symbol_table_baset &_symbol_table,
28
+ const class_hierarchyt &_class_hierarchy);
28
29
29
30
void operator ()(goto_functionst &goto_functions);
30
31
@@ -36,17 +37,17 @@ class remove_virtual_functionst
36
37
const dispatch_table_entriest &functions,
37
38
virtual_dispatch_fallback_actiont fallback_action);
38
39
40
+ void get_functions (const exprt &, dispatch_table_entriest &);
41
+
39
42
protected:
40
43
const namespacet ns;
41
44
const symbol_table_baset &symbol_table;
42
45
43
- class_hierarchyt class_hierarchy;
46
+ const class_hierarchyt & class_hierarchy;
44
47
45
48
void remove_virtual_function (
46
49
goto_programt &goto_program,
47
50
goto_programt::targett target);
48
-
49
- void get_functions (const exprt &, dispatch_table_entriest &);
50
51
typedef std::function<
51
52
resolve_inherited_componentt::inherited_componentt (
52
53
const irep_idt &,
@@ -64,11 +65,12 @@ class remove_virtual_functionst
64
65
};
65
66
66
67
remove_virtual_functionst::remove_virtual_functionst (
67
- const symbol_table_baset &_symbol_table):
68
- ns(_symbol_table),
69
- symbol_table(_symbol_table)
68
+ const symbol_table_baset &_symbol_table,
69
+ const class_hierarchyt &_class_hierarchy)
70
+ : ns(_symbol_table),
71
+ symbol_table(_symbol_table),
72
+ class_hierarchy(_class_hierarchy)
70
73
{
71
- class_hierarchy (symbol_table);
72
74
}
73
75
74
76
void remove_virtual_functionst::remove_virtual_function (
@@ -528,7 +530,9 @@ void remove_virtual_functions(
528
530
const symbol_table_baset &symbol_table,
529
531
goto_functionst &goto_functions)
530
532
{
531
- remove_virtual_functionst rvf (symbol_table);
533
+ class_hierarchyt class_hierarchy;
534
+ class_hierarchy (symbol_table);
535
+ remove_virtual_functionst rvf (symbol_table, class_hierarchy);
532
536
rvf (goto_functions);
533
537
}
534
538
@@ -540,7 +544,9 @@ void remove_virtual_functions(goto_modelt &goto_model)
540
544
541
545
void remove_virtual_functions (goto_model_functiont &function)
542
546
{
543
- remove_virtual_functionst rvf (function.get_symbol_table ());
547
+ class_hierarchyt class_hierarchy;
548
+ class_hierarchy (function.get_symbol_table ());
549
+ remove_virtual_functionst rvf (function.get_symbol_table (), class_hierarchy);
544
550
bool changed = rvf.remove_virtual_functions (
545
551
function.get_goto_function ().body );
546
552
// Give fresh location numbers to `function`, in case it has grown:
@@ -555,8 +561,20 @@ void remove_virtual_function(
555
561
const dispatch_table_entriest &dispatch_table,
556
562
virtual_dispatch_fallback_actiont fallback_action)
557
563
{
558
- remove_virtual_functionst rvf (goto_model.symbol_table );
564
+ class_hierarchyt class_hierarchy;
565
+ class_hierarchy (goto_model.symbol_table );
566
+ remove_virtual_functionst rvf (goto_model.symbol_table , class_hierarchy);
559
567
560
568
rvf.remove_virtual_function (
561
569
goto_program, instruction, dispatch_table, fallback_action);
562
570
}
571
+
572
+ void collect_virtual_function_callees (
573
+ const exprt &function,
574
+ const symbol_table_baset &symbol_table,
575
+ const class_hierarchyt &class_hierarchy,
576
+ dispatch_table_entriest &overridden_functions)
577
+ {
578
+ remove_virtual_functionst instance (symbol_table, class_hierarchy);
579
+ instance.get_functions (function, overridden_functions);
580
+ }
0 commit comments