@@ -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,9 +27,25 @@ std::string get_cprover_library_text(
3527 if (config.ansi_c .string_abstraction )
3628 library_text << " #define __CPROVER_STRING_ABSTRACTION\n " ;
3729
30+ const struct cprover_library_entryt cprover_library[] =
31+ #include " cprover_library.inc"
32+ ; // NOLINT(whitespace/semicolon)
33+
34+ return get_cprover_library_text (
35+ functions, symbol_table, cprover_library, library_text.str ());
36+ }
37+
38+ std::string get_cprover_library_text (
39+ const std::set<irep_idt> &functions,
40+ const symbol_tablet &symbol_table,
41+ const struct cprover_library_entryt cprover_library[],
42+ const std::string &prologue)
43+ {
44+ std::ostringstream library_text (prologue);
45+
3846 std::size_t count=0 ;
3947
40- for (cprover_library_entryt *e=cprover_library;
48+ for (const cprover_library_entryt *e=cprover_library;
4149 e->function !=nullptr ;
4250 e++)
4351 {
@@ -63,7 +71,7 @@ std::string get_cprover_library_text(
6371 return library_text.str ();
6472}
6573
66- void add_cprover_library (
74+ void add_cprover_c_library (
6775 const std::set<irep_idt> &functions,
6876 symbol_tablet &symbol_table,
6977 message_handlert &message_handler)
0 commit comments