12 #ifndef CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H 13 #define CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H 29 const bool use_system_headers,
30 const bool use_all_headers,
31 const bool include_harness,
87 static std::string
indent(
const unsigned n)
89 return std::string(2*n,
' ');
100 assert(!d_str.empty());
101 assert(*d_str.rbegin()==
';');
103 return d_str.substr(0, d_str.size()-1);
110 std::unordered_set<irep_idt> &dependencies);
116 std::ostream &os_body);
119 const typet &unresolved,
124 const typet &unresolved,
140 const bool skip_main,
141 std::ostream &os_decl,
142 std::ostream &os_body,
147 const std::list<irep_idt> &local_static,
149 std::list<irep_idt> &type_decls);
153 const std::list<irep_idt> &type_decls);
159 std::list<irep_idt> &local_static,
160 std::list<irep_idt> &local_type_decls);
164 #endif // CPROVER_GOTO_INSTRUMENT_DUMP_C_CLASS_H
The type of an expression, extends irept.
std::unique_ptr< languaget >(* language_factoryt)()
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...
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::unordered_set< irep_idt > dependencies
declared_enum_constants_mapt declared_enum_constants
std::string type_to_string(const typet &type)
std::unordered_map< irep_idt, code_declt > local_static_declst
std::string expr_to_string(const exprt &expr)
std::map< irep_idt, typedef_infot > typedef_mapt
const goto_functionst & goto_functions
convertedt converted_enum
std::unordered_set< irep_idt > convertedt
std::string make_decl(const irep_idt &identifier, const typet &type)
dump_ct(const goto_functionst &_goto_functions, const bool use_system_headers, const bool use_all_headers, const bool include_harness, const namespacet &_ns, language_factoryt factory)
typedef_typest typedef_types
void insert_local_type_decls(code_blockt &b, const std::list< irep_idt > &type_decls)
A codet representing the declaration of a local variable.
std::string type_decl_str
void convert_compound(const typet &type, const typet &unresolved, bool recursive, std::ostream &os)
void cleanup_decl(code_declt &decl, std::list< irep_idt > &local_static, std::list< irep_idt > &local_type_decls)
virtual ~dump_ct()=default
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Abstract interface to support a programming language.
void gather_global_typedefs()
Find all global typdefs in the symbol table and store them in typedef_types.
system_library_symbolst system_symbols
A collection of goto functions.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
std::set< std::string > system_headers
std::unique_ptr< languaget > language
convertedt converted_global
std::unordered_map< irep_idt, irep_idt > declared_enum_constants_mapt
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...
void convert_compound_declaration(const symbolt &symbol, std::ostream &os_body)
declare compound types
Base type for structs and unions.
void cleanup_expr(exprt &expr)
std::unordered_map< typet, irep_idt, irep_hash > typedef_typest
Base class for all expressions.
void convert_compound_enum(const typet &type, std::ostream &os)
void set_use_all_headers(bool use)
void operator()(std::ostream &out)
A codet representing sequential composition of program statements.
static std::string indent(const unsigned n)
Expression to hold a symbol (variable)
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)
void dump_typedefs(std::ostream &os) const
Print all typedefs that are not covered via typedef struct xyz { ...
typedef_infot(const irep_idt &name)
convertedt converted_compound
void cleanup_type(typet &type)
symbol_tablet copied_symbol_table
void convert_global_variable(const symbolt &symbol, std::ostream &os, local_static_declst &local_static_decls)
void cleanup_harness(code_blockt &b)
Replace CPROVER internal symbols in b by printable values and generate necessary declarations.