18 const irept &components=
35 assert(symbol.
type.
id()==ID_struct ||
36 symbol.
type.
id()==ID_union);
41 name.set(ID_C_source_location, symbol.
location);
44 decl.
name().
id(ID_cpp_name);
46 decl.
type().
id(ID_function_type);
51 decl.
value().
set(ID_statement, ID_block);
56 dtor.
add(ID_storage_spec).
id(ID_cpp_storage_spec);
65 assert(symbol.
type.
id()==ID_struct ||
66 symbol.
type.
id()==ID_union);
80 for(struct_union_typet::componentst::const_iterator
81 cit=components.begin();
82 cit!=components.end();
85 if(cit->get_bool(
"is_vtptr"))
88 name.
set(ID_identifier, cit->get(ID_base_name));
93 const symbolt &virtual_table_symbol_type =
94 lookup(cit->type().subtype().get(ID_identifier));
100 exprt var=virtual_table_symbol_var.symbol_expr();
102 assert(address.
type()==cit->type());
106 exprt ptrmember(ID_ptrmember);
107 ptrmember.
set(ID_component_name, cit->get(ID_name));
117 for(struct_union_typet::componentst::const_reverse_iterator
118 cit=components.rbegin();
119 cit!=components.rend();
122 const typet &type=cit->type();
124 if(cit->get_bool(ID_from_base) ||
125 cit->get_bool(ID_is_type) ||
126 cit->get_bool(ID_is_static) ||
127 type.
id()==ID_code ||
133 name.
set(ID_identifier, cit->get(ID_base_name));
134 name.
set(ID_C_source_location, source_location);
137 cppname.
get_sub().push_back(name);
139 exprt member(ID_ptrmember, type);
140 member.
set(ID_component_cpp_name, cppname);
157 for(irept::subt::const_reverse_iterator
162 assert(bit->id()==ID_base);
163 assert(bit->find(ID_type).id()==ID_symbol);
164 const symbolt &psymb =
lookup(bit->find(ID_type).get(ID_identifier));
168 object.add_source_location() = source_location;
The type of an expression.
irep_idt name
The unique identifier.
void set_function(const irep_idt &function)
codet dtor(const symbolt &symb)
produces destructor code for a class object
const std::string & id2string(const irep_idt &d)
pointer_typet pointer_type(const typet &subtype)
std::vector< irept > subt
void move_to_sub(irept &irep)
std::vector< componentt > componentst
void move_to_operands(exprt &expr)
void already_typechecked(irept &irep)
const componentst & components() const
void default_dtor(const symbolt &symb, cpp_declarationt &dtor)
Note:
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
codet cpp_destructor(const source_locationt &source_location, const exprt &object)
const irep_idt & id() const
bool cpp_is_pod(const typet &type) const
Operator to dereference a pointer.
bool is_reference(const typet &type)
TO_BE_DOCUMENTED.
Base class for tree-like data structures with sharing.
C++ Language Type Checking.
Operator to return the address of an object.
bool find_dtor(const symbolt &symbol) const
const source_locationt & source_location() const
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
Base class for all expressions.
irep_idt base_name
Base (non-scoped) name.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a generic typet to a struct_union_typet.
irept & add(const irep_namet &name)
bool disable_access_control
source_locationt & add_source_location()
Expression to hold a symbol (variable)
A statement in a programming language.
const typet & subtype() const
const irept & find(const irep_namet &name) const
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See namespace_baset::lookup().
void set(const irep_namet &name, const irep_idt &value)
#define forall_irep(it, irep)