cprover
dump_ct Class Reference

#include <dump_c_class.h>

Collaboration diagram for dump_ct:
[legend]

Classes

struct  typedef_infot
 

Public Member Functions

 dump_ct (const goto_functionst &_goto_functions, const bool use_system_headers, const bool use_all_headers, const namespacet &_ns, language_factoryt factory)
 
virtual ~dump_ct ()
 
void operator() (std::ostream &out)
 

Protected Types

typedef std::unordered_set< irep_idt, irep_id_hashconvertedt
 
typedef std::unordered_map< irep_idt, std::string, irep_id_hashsystem_library_mapt
 
typedef std::unordered_map< irep_idt, irep_idt, irep_id_hashdeclared_enum_constants_mapt
 
typedef std::map< irep_idt, typedef_infottypedef_mapt
 
typedef std::unordered_map< typet, irep_idt, irep_hashtypedef_typest
 
typedef std::unordered_map< irep_idt, code_declt, irep_id_hashlocal_static_declst
 

Protected Member Functions

void init_system_library_map ()
 
std::string type_to_string (const typet &type)
 
std::string expr_to_string (const exprt &expr)
 
bool ignore (const symbolt &symbol)
 
bool ignore (const typet &type)
 
std::string make_decl (const irep_idt &identifier, const typet &type)
 
void collect_typedefs (const typet &type, bool early)
 
void collect_typedefs_rec (const typet &type, bool early, std::unordered_set< irep_idt, irep_id_hash > &dependencies)
 
void gather_global_typedefs ()
 
void dump_typedefs (std::ostream &os) const
 
void convert_compound_declaration (const symbolt &symbol, std::ostream &os_body)
 declare compound types More...
 
void convert_compound (const typet &type, const typet &unresolved, bool recursive, std::ostream &os)
 
void convert_compound (const struct_union_typet &type, const typet &unresolved, bool recursive, std::ostream &os)
 
void convert_compound_enum (const typet &type, std::ostream &os)
 
void convert_global_variable (const symbolt &symbol, std::ostream &os, local_static_declst &local_static_decls)
 
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 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)
 
void insert_local_type_decls (code_blockt &b, const std::list< irep_idt > &type_decls)
 
void cleanup_expr (exprt &expr)
 
void cleanup_type (typet &type)
 
void cleanup_decl (code_declt &decl, std::list< irep_idt > &local_static, std::list< irep_idt > &local_type_decls)
 

Static Protected Member Functions

static std::string indent (const unsigned n)
 

Protected Attributes

const goto_functionstgoto_functions
 
symbol_tablet copied_symbol_table
 
const namespacet ns
 
languagetlanguage
 
const bool use_all_headers
 
convertedt converted_compound
 
convertedt converted_global
 
convertedt converted_enum
 
std::set< std::string > system_headers
 
system_library_mapt system_library_map
 
declared_enum_constants_mapt declared_enum_constants
 
typedef_mapt typedef_map
 
typedef_typest typedef_types
 

Detailed Description

Definition at line 22 of file dump_c_class.h.

Member Typedef Documentation

§ convertedt

typedef std::unordered_set<irep_idt, irep_id_hash> dump_ct::convertedt
protected

Definition at line 55 of file dump_c_class.h.

§ declared_enum_constants_mapt

typedef std::unordered_map<irep_idt, irep_idt, irep_id_hash> dump_ct::declared_enum_constants_mapt
protected

Definition at line 65 of file dump_c_class.h.

§ local_static_declst

typedef std::unordered_map<irep_idt, code_declt, irep_id_hash> dump_ct::local_static_declst
protected

Definition at line 140 of file dump_c_class.h.

§ system_library_mapt

typedef std::unordered_map<irep_idt, std::string, irep_id_hash> dump_ct::system_library_mapt
protected

Definition at line 61 of file dump_c_class.h.

§ typedef_mapt

typedef std::map<irep_idt, typedef_infot> dump_ct::typedef_mapt
protected

Definition at line 82 of file dump_c_class.h.

§ typedef_typest

typedef std::unordered_map<typet, irep_idt, irep_hash> dump_ct::typedef_typest
protected

Definition at line 84 of file dump_c_class.h.

Constructor & Destructor Documentation

§ dump_ct()

dump_ct::dump_ct ( const goto_functionst _goto_functions,
const bool  use_system_headers,
const bool  use_all_headers,
const namespacet _ns,
language_factoryt  factory 
)
inline

Definition at line 25 of file dump_c_class.h.

References init_system_library_map().

§ ~dump_ct()

virtual dump_ct::~dump_ct ( )
inlinevirtual

Definition at line 41 of file dump_c_class.h.

References language, and operator()().

Member Function Documentation

§ cleanup_decl()

void dump_ct::cleanup_decl ( code_declt decl,
std::list< irep_idt > &  local_static,
std::list< irep_idt > &  local_type_decls 
)
protected

§ cleanup_expr()

§ cleanup_type()

§ collect_typedefs()

void dump_ct::collect_typedefs ( const typet type,
bool  early 
)
protected

§ collect_typedefs_rec()

void dump_ct::collect_typedefs_rec ( const typet type,
bool  early,
std::unordered_set< irep_idt, irep_id_hash > &  dependencies 
)
protected

§ convert_compound() [1/2]

void dump_ct::convert_compound ( const typet type,
const typet unresolved,
bool  recursive,
std::ostream &  os 
)
protected

§ convert_compound() [2/2]

§ convert_compound_declaration()

void dump_ct::convert_compound_declaration ( const symbolt symbol,
std::ostream &  os_body 
)
protected

declare compound types

Definition at line 294 of file dump_c.cpp.

References convert_compound(), dstringt::empty(), source_locationt::get_function(), irept::id(), symbolt::location, symbolt::name, and symbolt::type.

Referenced by make_decl(), and operator()().

§ convert_compound_enum()

void dump_ct::convert_compound_enum ( const typet type,
std::ostream &  os 
)
protected

§ convert_function_declaration()

void dump_ct::convert_function_declaration ( const symbolt symbol,
const bool  skip_main,
std::ostream &  os_decl,
std::ostream &  os_body,
local_static_declst local_static_decls 
)
protected

§ convert_global_variable()

§ dump_typedefs()

void dump_ct::dump_typedefs ( std::ostream &  os) const
protected

§ expr_to_string()

std::string dump_ct::expr_to_string ( const exprt expr)
protected

§ gather_global_typedefs()

§ ignore() [1/2]

§ ignore() [2/2]

bool dump_ct::ignore ( const typet type)
protected

Definition at line 785 of file dump_c.cpp.

References ignore(), and symbolt::type.

§ indent()

static std::string dump_ct::indent ( const unsigned  n)
inlinestaticprotected

Definition at line 95 of file dump_c_class.h.

Referenced by convert_compound().

§ init_system_library_map()

void dump_ct::init_system_library_map ( )
protected

Definition at line 589 of file dump_c.cpp.

References ADD_TO_SYSTEM_LIBRARY.

Referenced by dump_ct().

§ insert_local_static_decls()

void dump_ct::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 
)
protected

§ insert_local_type_decls()

void dump_ct::insert_local_type_decls ( code_blockt b,
const std::list< irep_idt > &  type_decls 
)
protected

§ make_decl()

§ operator()()

§ type_to_string()

std::string dump_ct::type_to_string ( const typet type)
protected

Definition at line 1626 of file dump_c.cpp.

References cleanup_type(), languaget::from_type(), language, and ns.

Referenced by convert_compound(), convert_compound_enum(), and operator()().

Member Data Documentation

§ converted_compound

convertedt dump_ct::converted_compound
protected

Definition at line 56 of file dump_c_class.h.

Referenced by convert_compound(), and convert_function_declaration().

§ converted_enum

convertedt dump_ct::converted_enum
protected

Definition at line 56 of file dump_c_class.h.

Referenced by convert_compound_enum(), and convert_function_declaration().

§ converted_global

convertedt dump_ct::converted_global
protected

Definition at line 56 of file dump_c_class.h.

Referenced by convert_global_variable().

§ copied_symbol_table

symbol_tablet dump_ct::copied_symbol_table
protected

§ declared_enum_constants

declared_enum_constants_mapt dump_ct::declared_enum_constants
protected

§ goto_functions

const goto_functionst& dump_ct::goto_functions
protected

Definition at line 49 of file dump_c_class.h.

Referenced by convert_function_declaration(), and operator()().

§ language

languaget* dump_ct::language
protected

Definition at line 52 of file dump_c_class.h.

Referenced by convert_compound(), expr_to_string(), type_to_string(), and ~dump_ct().

§ ns

§ system_headers

std::set<std::string> dump_ct::system_headers
protected

§ system_library_map

system_library_mapt dump_ct::system_library_map
protected

Definition at line 62 of file dump_c_class.h.

Referenced by ignore().

§ typedef_map

§ typedef_types

typedef_typest dump_ct::typedef_types
protected

Definition at line 85 of file dump_c_class.h.

Referenced by convert_compound(), and gather_global_typedefs().

§ use_all_headers

const bool dump_ct::use_all_headers
protected

Definition at line 53 of file dump_c_class.h.

Referenced by ignore().


The documentation for this class was generated from the following files: