|
| 1 | +/*******************************************************************\ |
| 2 | +
|
| 3 | +Module: |
| 4 | +
|
| 5 | +Author: Michael Tautschnig |
| 6 | +
|
| 7 | +\*******************************************************************/ |
| 8 | + |
| 9 | +#include "cprover_library.h" |
| 10 | + |
| 11 | +#include <sstream> |
| 12 | + |
| 13 | +#include <util/config.h> |
| 14 | + |
| 15 | +#include <ansi-c/cprover_library.h> |
| 16 | + |
| 17 | +static std::string get_cprover_library_text( |
| 18 | + const std::set<irep_idt> &functions, |
| 19 | + const symbol_tablet &symbol_table) |
| 20 | +{ |
| 21 | + std::ostringstream library_text; |
| 22 | + |
| 23 | + library_text << "#line 1 \"<builtin-library>\"\n" |
| 24 | + << "#undef inline\n"; |
| 25 | + |
| 26 | + // cprover_library.inc may not have been generated when running Doxygen, thus |
| 27 | + // make Doxygen skip this part |
| 28 | + /// \cond |
| 29 | + const struct cprover_library_entryt cprover_library[] = |
| 30 | +#include "cprover_library.inc" |
| 31 | + ; // NOLINT(whitespace/semicolon) |
| 32 | + /// \endcond |
| 33 | + |
| 34 | + return get_cprover_library_text( |
| 35 | + functions, symbol_table, cprover_library, library_text.str()); |
| 36 | +} |
| 37 | + |
| 38 | +void add_cprover_cpp_library( |
| 39 | + const std::set<irep_idt> &functions, |
| 40 | + symbol_tablet &symbol_table, |
| 41 | + message_handlert &message_handler) |
| 42 | +{ |
| 43 | + if(config.ansi_c.lib == configt::ansi_ct::libt::LIB_NONE) |
| 44 | + return; |
| 45 | + |
| 46 | + const std::string library_text = |
| 47 | + get_cprover_library_text(functions, symbol_table); |
| 48 | + |
| 49 | + add_library(library_text, symbol_table, message_handler); |
| 50 | +} |
0 commit comments