@@ -27,30 +27,6 @@ void link_to_library(
27
27
const std::function<
28
28
void (const std::set<irep_idt> &, symbol_tablet &, message_handlert &)>
29
29
&library)
30
- {
31
- link_to_library (
32
- goto_model.symbol_table ,
33
- goto_model.goto_functions ,
34
- message_handler,
35
- library);
36
- }
37
-
38
- // / Complete missing function definitions using the \p library.
39
- // / \param symbol_table: symbol table that may contain symbols with missing
40
- // / function bodies
41
- // / \param goto_functions: goto functions that may contain function calls with
42
- // / missing function bodies
43
- // / \param message_handler: message handler to report library processing
44
- // / problems
45
- // / \param library: generator function that produces function definitions for a
46
- // / given set of symbol names that have no body.
47
- void link_to_library (
48
- symbol_tablet &symbol_table,
49
- goto_functionst &goto_functions,
50
- message_handlert &message_handler,
51
- const std::function<
52
- void (const std::set<irep_idt> &, symbol_tablet &, message_handlert &)>
53
- &library)
54
30
{
55
31
// this needs a fixedpoint, as library functions
56
32
// may depend on other library functions
@@ -60,19 +36,20 @@ void link_to_library(
60
36
while (true )
61
37
{
62
38
std::unordered_set<irep_idt> called_functions =
63
- compute_called_functions (goto_functions);
39
+ compute_called_functions (goto_model. goto_functions );
64
40
65
41
// eliminate those for which we already have a body
66
42
67
43
std::set<irep_idt> missing_functions;
68
44
69
45
for (const auto &id : called_functions)
70
46
{
71
- goto_functionst::function_mapt::const_iterator
72
- f_it= goto_functions.function_map .find (id);
47
+ goto_functionst::function_mapt::const_iterator f_it =
48
+ goto_model. goto_functions .function_map .find (id);
73
49
74
- if (f_it!=goto_functions.function_map .end () &&
75
- f_it->second .body_available ())
50
+ if (
51
+ f_it != goto_model.goto_functions .function_map .end () &&
52
+ f_it->second .body_available ())
76
53
{
77
54
// it's overridden!
78
55
}
@@ -88,13 +65,21 @@ void link_to_library(
88
65
if (missing_functions.empty ())
89
66
break ;
90
67
91
- library (missing_functions, symbol_table, message_handler);
68
+ library (missing_functions, goto_model. symbol_table , message_handler);
92
69
93
70
// convert to CFG
94
71
for (const auto &id : missing_functions)
95
72
{
96
- if (symbol_table.symbols .find (id)!=symbol_table.symbols .end ())
97
- goto_convert (id, symbol_table, goto_functions, message_handler);
73
+ if (
74
+ goto_model.symbol_table .symbols .find (id) !=
75
+ goto_model.symbol_table .symbols .end ())
76
+ {
77
+ goto_convert (
78
+ id,
79
+ goto_model.symbol_table ,
80
+ goto_model.goto_functions ,
81
+ message_handler);
82
+ }
98
83
99
84
added_functions.insert (id);
100
85
}
0 commit comments