|
11 | 11 |
|
12 | 12 | #include "link_to_library.h"
|
13 | 13 |
|
14 |
| -#include <util/config.h> |
15 |
| - |
16 |
| -#include <ansi-c/cprover_library.h> |
17 |
| - |
18 | 14 | #include "compute_called_functions.h"
|
19 | 15 | #include "goto_convert_functions.h"
|
20 | 16 |
|
| 17 | +/// Complete missing function definitions using the \p library. |
| 18 | +/// \param goto_model goto model that may contain function calls and symbols |
| 19 | +/// with missing function bodies |
| 20 | +/// \param message_handler message handler to report library processing |
| 21 | +/// problems |
| 22 | +/// \param library generator function that produces function definitions for a |
| 23 | +/// given set of symbol names that have no body. |
21 | 24 | void link_to_library(
|
22 | 25 | goto_modelt &goto_model,
|
23 |
| - message_handlert &message_handler) |
| 26 | + message_handlert &message_handler, |
| 27 | + const std::function< |
| 28 | + void(const std::set<irep_idt> &, symbol_tablet &, message_handlert &)> |
| 29 | + &library) |
24 | 30 | {
|
25 | 31 | link_to_library(
|
26 | 32 | goto_model.symbol_table,
|
27 | 33 | goto_model.goto_functions,
|
28 |
| - message_handler); |
| 34 | + message_handler, |
| 35 | + library); |
29 | 36 | }
|
30 | 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. |
31 | 47 | void link_to_library(
|
32 | 48 | symbol_tablet &symbol_table,
|
33 | 49 | goto_functionst &goto_functions,
|
34 |
| - message_handlert &message_handler) |
| 50 | + message_handlert &message_handler, |
| 51 | + const std::function< |
| 52 | + void(const std::set<irep_idt> &, symbol_tablet &, message_handlert &)> |
| 53 | + &library) |
35 | 54 | {
|
36 | 55 | // this needs a fixedpoint, as library functions
|
37 | 56 | // may depend on other library functions
|
@@ -69,7 +88,7 @@ void link_to_library(
|
69 | 88 | if(missing_functions.empty())
|
70 | 89 | break;
|
71 | 90 |
|
72 |
| - add_cprover_library(missing_functions, symbol_table, message_handler); |
| 91 | + library(missing_functions, symbol_table, message_handler); |
73 | 92 |
|
74 | 93 | // convert to CFG
|
75 | 94 | for(const auto &id : missing_functions)
|
|
0 commit comments