Skip to content

Commit f20f307

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 13a8dc8 commit f20f307

File tree

2 files changed

+17
-40
lines changed

2 files changed

+17
-40
lines changed

src/goto-programs/link_to_library.cpp

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,6 @@ void link_to_library(
2727
const std::function<
2828
void(const std::set<irep_idt> &, symbol_tablet &, message_handlert &)>
2929
&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)
5430
{
5531
// this needs a fixedpoint, as library functions
5632
// may depend on other library functions
@@ -60,19 +36,20 @@ void link_to_library(
6036
while(true)
6137
{
6238
std::unordered_set<irep_idt> called_functions =
63-
compute_called_functions(goto_functions);
39+
compute_called_functions(goto_model.goto_functions);
6440

6541
// eliminate those for which we already have a body
6642

6743
std::set<irep_idt> missing_functions;
6844

6945
for(const auto &id : called_functions)
7046
{
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);
7349

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())
7653
{
7754
// it's overridden!
7855
}
@@ -88,13 +65,21 @@ void link_to_library(
8865
if(missing_functions.empty())
8966
break;
9067

91-
library(missing_functions, symbol_table, message_handler);
68+
library(missing_functions, goto_model.symbol_table, message_handler);
9269

9370
// convert to CFG
9471
for(const auto &id : missing_functions)
9572
{
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+
}
9883

9984
added_functions.insert(id);
10085
}

src/goto-programs/link_to_library.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,10 @@ Author: Daniel Kroening, [email protected]
1717

1818
#include <util/irep.h>
1919

20-
class goto_functionst;
2120
class goto_modelt;
2221
class message_handlert;
2322
class symbol_tablet;
2423

25-
void link_to_library(
26-
symbol_tablet &,
27-
goto_functionst &,
28-
message_handlert &,
29-
const std::function<
30-
void(const std::set<irep_idt> &, symbol_tablet &, message_handlert &)> &);
31-
3224
void link_to_library(
3325
goto_modelt &,
3426
message_handlert &,

0 commit comments

Comments
 (0)