12 #ifndef CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H
13 #define CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H
23 #include <unordered_set>
64 this->include_function_decls =
false;
70 this->include_function_bodies =
false;
76 this->include_global_decls =
false;
82 this->include_typedefs =
false;
88 this->include_global_vars =
false;
94 this->include_compounds =
false;
100 this->follow_compounds =
false;
106 this->include_headers =
true;
116 const bool use_system_headers,
117 const bool use_all_headers,
118 const bool include_harness,
135 const bool use_system_headers,
136 const bool use_all_headers,
137 const bool include_harness,
194 static std::string
indent(
const unsigned n)
196 return std::string(2*n,
' ');
210 return d_str.substr(0, d_str.size()-1);
217 std::unordered_set<irep_idt> &dependencies);
223 std::ostream &os_body);
226 const typet &unresolved,
231 const typet &unresolved,
247 const bool skip_main,
248 std::ostream &os_decl,
249 std::ostream &os_body,
254 const std::list<irep_idt> &local_static,
256 std::list<irep_idt> &type_decls);
260 const std::list<irep_idt> &type_decls);
266 std::list<irep_idt> &local_static,
267 std::list<irep_idt> &local_type_decls);
A codet representing sequential composition of program statements.
A codet representing the declaration of a local variable.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::unordered_set< irep_idt > convertedt
void convert_compound_declaration(const symbolt &symbol, std::ostream &os_body)
declare compound types
void convert_compound(const typet &type, const typet &unresolved, bool recursive, std::ostream &os)
virtual ~dump_ct()=default
void insert_local_type_decls(code_blockt &b, const std::list< irep_idt > &type_decls)
void cleanup_expr(exprt &expr)
void insert_local_static_decls(code_blockt &b, const std::list< irep_idt > &local_static, local_static_declst &local_static_decls, std::list< irep_idt > &type_decls)
std::string expr_to_string(const exprt &expr)
void operator()(std::ostream &out)
const goto_functionst & goto_functions
convertedt converted_compound
void collect_typedefs(const typet &type, bool early)
Find any typedef names contained in the input type and store their declaration strings in typedef_map...
dump_ct(const goto_functionst &_goto_functions, const bool use_system_headers, const bool use_all_headers, const bool include_harness, const namespacet &_ns, const irep_idt &mode)
void gather_global_typedefs()
Find all global typdefs in the symbol table and store them in typedef_types.
typedef_typest typedef_types
symbol_tablet copied_symbol_table
void collect_typedefs_rec(const typet &type, bool early, std::unordered_set< irep_idt > &dependencies)
Find any typedef names contained in the input type and store their declaration strings in typedef_map...
declared_enum_constants_mapt declared_enum_constants
std::string make_decl(const irep_idt &identifier, const typet &type)
convertedt converted_enum
void convert_global_variable(const symbolt &symbol, std::ostream &os, local_static_declst &local_static_decls)
std::set< std::string > system_headers
void dump_typedefs(std::ostream &os) const
Print all typedefs that are not covered via typedef struct xyz { ...
system_library_symbolst system_symbols
void convert_compound_enum(const typet &type, std::ostream &os)
std::unordered_map< irep_idt, irep_idt > declared_enum_constants_mapt
std::map< irep_idt, typedef_infot > typedef_mapt
const dump_c_configurationt dump_c_config
void cleanup_harness(code_blockt &b)
Replace CPROVER internal symbols in b by printable values and generate necessary declarations.
void cleanup_type(typet &type)
void cleanup_decl(code_frontend_declt &decl, std::list< irep_idt > &local_static, std::list< irep_idt > &local_type_decls)
std::string type_to_string(const typet &type)
std::unordered_map< typet, irep_idt, irep_hash > typedef_typest
std::unordered_map< irep_idt, code_frontend_declt > local_static_declst
static std::string indent(const unsigned n)
void convert_function_declaration(const symbolt &symbol, const bool skip_main, std::ostream &os_decl, std::ostream &os_body, local_static_declst &local_static_decls)
dump_ct(const goto_functionst &_goto_functions, const bool use_system_headers, const bool use_all_headers, const bool include_harness, const namespacet &_ns, const irep_idt &mode, const dump_c_configurationt config)
convertedt converted_global
Base class for all expressions.
A collection of goto functions.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Base type for structs and unions.
Expression to hold a symbol (variable)
void set_use_all_headers(bool use)
The type of an expression, extends irept.
#define CHECK_RETURN(CONDITION)
Used for configuring the behaviour of dump_c.
dump_c_configurationt disable_include_function_decls()
dump_c_configurationt disable_include_typedefs()
dump_c_configurationt disable_follow_compounds()
bool include_global_decls
Include the global declarations in the dump.
bool include_typedefs
Include the typedefs in the dump.
bool include_global_vars
Include global variable definitions in the dump.
static dump_c_configurationt default_configuration
The default used for dump-c and dump-cpp.
bool include_function_decls
Include the function declarations in the dump.
bool include_headers
Include headers type declarations are borrowed from.
bool include_compounds
Include struct definitions in the dump.
dump_c_configurationt disable_include_global_vars()
dump_c_configurationt disable_include_compunds()
static dump_c_configurationt type_header_configuration
The config used for dump-c-type-header.
dump_c_configurationt disable_include_function_bodies()
dump_c_configurationt disable_include_global_decls()
dump_c_configurationt enable_include_headers()
bool include_function_bodies
Include the functions in the dump.
bool follow_compounds
Define whether to follow compunds recursively.
typedef_infot(const irep_idt &name)
std::unordered_set< irep_idt > dependencies
std::string type_decl_str