Skip to content

Commit afd4c6e

Browse files
committed
Remove link_to_library(goto_functions, symbol_table, ...)
There are no in-tree uses of this function. External users should use link_to_library(goto_model, ...). This is in preparation of further changes that will only support the goto_modelt-variant.
1 parent a46f12d commit afd4c6e

File tree

2 files changed

+0
-74
lines changed

2 files changed

+0
-74
lines changed

src/goto-programs/link_to_library.cpp

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
}

src/goto-programs/link_to_library.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,11 @@ Author: Daniel Kroening, [email protected]
1818
#include <util/deprecate.h>
1919
#include <util/irep.h>
2020

21-
class goto_functionst;
2221
class goto_modelt;
2322
class message_handlert;
2423
class symbol_tablet;
2524

2625
DEPRECATED(SINCE(2019, 2, 28, "Use link_to_library(goto_model, ...) instead"))
27-
void link_to_library(
28-
symbol_tablet &,
29-
goto_functionst &,
30-
message_handlert &,
31-
const std::function<
32-
void(const std::set<irep_idt> &, symbol_tablet &, message_handlert &)> &);
33-
3426
void link_to_library(
3527
goto_modelt &,
3628
message_handlert &,

0 commit comments

Comments
 (0)