@@ -14,15 +14,7 @@ Author: Daniel Kroening, kroening@kroening.com
1414
1515#include " ansi_c_language.h"
1616
17- struct cprover_library_entryt
18- {
19- const char *function;
20- const char *model;
21- } cprover_library[]=
22- #include " cprover_library.inc"
23- ; // NOLINT(whitespace/semicolon)
24-
25- std::string get_cprover_library_text (
17+ static std::string get_cprover_library_text (
2618 const std::set<irep_idt> &functions,
2719 const symbol_tablet &symbol_table)
2820{
@@ -35,10 +27,29 @@ std::string get_cprover_library_text(
3527 if (config.ansi_c .string_abstraction )
3628 library_text << " #define __CPROVER_STRING_ABSTRACTION\n " ;
3729
30+ // cprover_library.inc may not have been generated when running Doxygen, thus
31+ // make Doxygen skip this part
32+ // / \cond
33+ const struct cprover_library_entryt cprover_library[] =
34+ #include " cprover_library.inc"
35+ ; // NOLINT(whitespace/semicolon)
36+ // / \endcond
37+
38+ return get_cprover_library_text (
39+ functions, symbol_table, cprover_library, library_text.str ());
40+ }
41+
42+ std::string get_cprover_library_text (
43+ const std::set<irep_idt> &functions,
44+ const symbol_tablet &symbol_table,
45+ const struct cprover_library_entryt cprover_library[],
46+ const std::string &prologue)
47+ {
48+ std::ostringstream library_text (prologue);
49+
3850 std::size_t count=0 ;
3951
40- for (cprover_library_entryt *e=cprover_library;
41- e->function !=nullptr ;
52+ for (const cprover_library_entryt *e = cprover_library; e->function != nullptr ;
4253 e++)
4354 {
4455 irep_idt id=e->function ;
@@ -63,7 +74,7 @@ std::string get_cprover_library_text(
6374 return library_text.str ();
6475}
6576
66- void add_cprover_library (
77+ void cprover_c_library_factory (
6778 const std::set<irep_idt> &functions,
6879 symbol_tablet &symbol_table,
6980 message_handlert &message_handler)
0 commit comments