-
Notifications
You must be signed in to change notification settings - Fork 273
/
Copy pathcprover_library.cpp
51 lines (37 loc) · 1.36 KB
/
cprover_library.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************\
Module:
Author: Michael Tautschnig
\*******************************************************************/
#include "cprover_library.h"
#include <sstream>
#include <util/config.h>
#include <ansi-c/cprover_library.h>
static std::string get_cprover_library_text(
const std::set<irep_idt> &functions,
const symbol_table_baset &symbol_table)
{
std::ostringstream library_text;
library_text << "#line 1 \"<builtin-library>\"\n"
<< "#undef inline\n";
// cprover_library.inc may not have been generated when running Doxygen, thus
// make Doxygen skip this part
/// \cond
const struct cprover_library_entryt cprover_library[] =
#include "cprover_library.inc" // IWYU pragma: keep
; // NOLINT(whitespace/semicolon)
/// \endcond
return get_cprover_library_text(
functions, symbol_table, cprover_library, library_text.str());
}
void cprover_cpp_library_factory(
const std::set<irep_idt> &functions,
const symbol_table_baset &symbol_table,
symbol_table_baset &dest_symbol_table,
message_handlert &message_handler)
{
if(config.ansi_c.lib == configt::ansi_ct::libt::LIB_NONE)
return;
const std::string library_text =
get_cprover_library_text(functions, symbol_table);
add_library(library_text, dest_symbol_table, message_handler);
}