16 const irept &components=
33 assert(symbol.
type.
id()==ID_struct ||
34 symbol.
type.
id()==ID_union);
39 name.set(ID_C_source_location, symbol.
location);
42 decl.
name().
id(ID_cpp_name);
44 decl.
type().
id(ID_function_type);
49 decl.
value().
set(ID_statement, ID_block);
54 dtor.
add(ID_storage_spec).
id(ID_cpp_storage_spec);
63 assert(symbol.
type.
id()==ID_struct ||
64 symbol.
type.
id()==ID_union);
78 for(struct_union_typet::componentst::const_iterator
79 cit=components.begin();
80 cit!=components.end();
83 if(cit->get_bool(
"is_vtptr"))
86 name.
set(ID_identifier, cit->get(ID_base_name));
91 const symbolt &virtual_table_symbol_type =
92 lookup(cit->type().subtype().get(ID_identifier));
98 exprt var=virtual_table_symbol_var.symbol_expr();
100 assert(address.
type()==cit->type());
104 exprt ptrmember(ID_ptrmember);
105 ptrmember.
set(ID_component_name, cit->get(ID_name));
115 for(struct_union_typet::componentst::const_reverse_iterator
116 cit=components.rbegin();
117 cit!=components.rend();
120 const typet &type=cit->type();
122 if(cit->get_bool(ID_from_base) ||
123 cit->get_bool(ID_is_type) ||
124 cit->get_bool(ID_is_static) ||
125 type.
id()==ID_code ||
131 name.
set(ID_identifier, cit->get(ID_base_name));
132 name.
set(ID_C_source_location, source_location);
135 cppname.
get_sub().push_back(name);
137 exprt member(ID_ptrmember);
138 member.
set(ID_component_cpp_name, cppname);
152 for(irept::subt::const_reverse_iterator
157 assert(bit->id()==ID_base);
158 assert(bit->find(ID_type).id()==ID_symbol);
159 const symbolt &psymb =
lookup(bit->find(ID_type).get(ID_identifier));
165 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)
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...
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.
codet cpp_destructor(const source_locationt &source_location, const typet &type, const exprt &object)
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)
source_locationt & add_source_location()
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)