@@ -85,69 +85,3 @@ void link_to_library(
8585 }
8686 }
8787}
88-
89- // / Complete missing function definitions using the \p library.
90- // / \param symbol_table: symbol table that may contain symbols with missing
91- // / function bodies
92- // / \param goto_functions: goto functions that may contain function calls with
93- // / missing function bodies
94- // / \param message_handler: message handler to report library processing
95- // / problems
96- // / \param library: generator function that produces function definitions for a
97- // / given set of symbol names that have no body.
98- void link_to_library (
99- symbol_tablet &symbol_table,
100- goto_functionst &goto_functions,
101- message_handlert &message_handler,
102- const std::function<
103- void (const std::set<irep_idt> &, symbol_tablet &, message_handlert &)>
104- &library)
105- {
106- // this needs a fixedpoint, as library functions
107- // may depend on other library functions
108-
109- std::set<irep_idt> added_functions;
110-
111- while (true )
112- {
113- std::unordered_set<irep_idt> called_functions =
114- compute_called_functions (goto_functions);
115-
116- // eliminate those for which we already have a body
117-
118- std::set<irep_idt> missing_functions;
119-
120- for (const auto &id : called_functions)
121- {
122- goto_functionst::function_mapt::const_iterator
123- f_it=goto_functions.function_map .find (id);
124-
125- if (f_it!=goto_functions.function_map .end () &&
126- f_it->second .body_available ())
127- {
128- // it's overridden!
129- }
130- else if (added_functions.find (id)!=added_functions.end ())
131- {
132- // already added
133- }
134- else
135- missing_functions.insert (id);
136- }
137-
138- // done?
139- if (missing_functions.empty ())
140- break ;
141-
142- library (missing_functions, symbol_table, message_handler);
143-
144- // convert to CFG
145- for (const auto &id : missing_functions)
146- {
147- if (symbol_table.symbols .find (id)!=symbol_table.symbols .end ())
148- goto_convert (id, symbol_table, goto_functions, message_handler);
149-
150- added_functions.insert (id);
151- }
152- }
153- }
0 commit comments