36 decl.
type().
id(ID_function_type);
44 dtor.
add(ID_storage_spec).
id(ID_cpp_storage_spec);
65 for(
const auto &c : components)
67 if(c.get_bool(ID_is_vtptr))
69 const cpp_namet cppname(c.get_base_name());
71 const symbolt &virtual_table_symbol_type =
84 exprt ptrmember(ID_ptrmember);
85 ptrmember.
set(ID_component_name, c.get_name());
86 ptrmember.
operands().push_back(this_expr);
95 for(struct_union_typet::componentst::const_reverse_iterator
96 cit=components.rbegin();
97 cit!=components.rend();
100 const typet &type=cit->type();
102 if(cit->get_bool(ID_from_base) ||
103 cit->get_bool(ID_is_type) ||
104 cit->get_bool(ID_is_static) ||
105 type.
id()==ID_code ||
110 const cpp_namet cppname(cit->get_base_name(), source_location);
112 exprt member(ID_ptrmember, type);
113 member.
set(ID_component_cpp_name, cppname);
114 member.
operands().push_back(this_expr);
122 if(dtor_code.has_value())
123 block.
add(dtor_code.value());
126 if(symbol.
type.
id() == ID_union)
127 return std::move(block);
132 for(class_typet::basest::const_reverse_iterator bit = bases.rbegin();
136 DATA_INVARIANT(bit->id() == ID_base,
"base class expression expected");
146 if(dtor_code.has_value())
147 block.
add(dtor_code.value());
150 return std::move(block);
Operator to return the address of an object.
static void make_already_typechecked(exprt &expr)
A codet representing sequential composition of program statements.
void add(const codet &code)
A codet representing an assignment in the program.
Data structure for representing an arbitrary statement in a program.
void default_dtor(const symbolt &symb, cpp_declarationt &dtor)
Note:
bool cpp_is_pod(const typet &type) const
codet dtor(const symbolt &symb, const symbol_exprt &this_expr)
produces destructor code for a class object
std::optional< codet > cpp_destructor(const source_locationt &source_location, const exprt &object)
bool disable_access_control
bool find_dtor(const symbolt &symbol) const
Operator to dereference a pointer.
Base class for all expressions.
source_locationt & add_source_location()
typet & type()
Return the type of the expression.
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
irept & add(const irep_idt &name)
const symbolt & lookup(const irep_idt &name) const
Lookup a symbol in the namespace.
const typet & base_type() const
The type of the data what we point to.
void set_function(const irep_idt &function)
const basest & bases() const
Get the collection of base classes/structs.
const componentst & components() const
std::vector< componentt > componentst
Expression to hold a symbol (variable)
irep_idt base_name
Base (non-scoped) name.
source_locationt location
Source code location of definition of symbol.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
The type of an expression, extends irept.
const source_locationt & source_location() const
source_locationt & add_source_location()
C++ Language Type Checking.
const std::string & id2string(const irep_idt &d)
API to expression classes for Pointers.
bool is_reference(const typet &type)
Returns true if the type is a reference.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.