cprover
irep_ids.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Internal Representation
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #include "irep_ids.h"
13 
14 #include <cassert>
15 
16 #include "string_container.h"
17 
18 const char *irep_ids_table[]=
19 {
20 #define IREP_ID_ONE(id) #id,
21 #define IREP_ID_TWO(id, str) #str,
22 
23 #include "irep_ids.def"
24 
25  nullptr,
26 };
27 
28 #ifdef USE_DSTRING
29 
30 #define IREP_ID_ONE(the_id) \
31  const dstringt ID_##the_id=dstringt::make_from_table_index( \
32  static_cast<unsigned>(idt::id_##the_id));
33 #define IREP_ID_TWO(the_id, str) \
34  const dstringt ID_##the_id=dstringt::make_from_table_index( \
35  static_cast<unsigned>(idt::id_##the_id));
36 
37 #else
38 
39 #define IREP_ID_ONE(the_id) const std::string ID_##the_id(#the_id);
40 #define IREP_ID_TWO(the_id, str) const std::string ID_##the_id(#the_id);
41 
42 #endif
43 
44 #include "irep_ids.def" // NOLINT(build/include)
45 
47 {
48  // this is called by the constructor of string_containert
49 
50  for(unsigned i=0; irep_ids_table[i]!=nullptr; i++)
51  {
52  unsigned x;
54  assert(x==i); // sanity check
55  }
56 }
Container for C-Strings.
const char * irep_ids_table[]
Definition: irep_ids.cpp:18
string_containert string_container
void initialize_string_container()
Definition: irep_ids.cpp:46