29 typet tmp_type(
object.type());
41 if(tmp_type.
id()==ID_array)
43 const exprt &size_expr=
46 if(size_expr.
id()==
"infinity")
53 exprt tmp_size=size_expr;
61 <<
"' is not a constant" <<
eom;
65 new_code.
type().
id(ID_code);
75 exprt index(ID_index);
101 for(struct_typet::componentst::const_iterator
102 it=components.begin();
103 it!=components.end();
106 const typet &type=it->type();
108 if(!it->get_bool(ID_from_base) &&
109 type.
id()==ID_code &&
110 type.
find(ID_return_type).
id()==ID_destructor)
112 dtor_name=it->get(ID_base_name);
118 assert(dtor_name!=
"");
120 irept cpp_name(ID_cpp_name);
122 cpp_name.
get_sub().back().set(ID_identifier, dtor_name);
123 cpp_name.
get_sub().back().set(ID_C_source_location, source_location);
127 function_call.
function().
swap(static_cast<exprt&>(cpp_name));
130 assert(function_call.
get(ID_statement)==ID_temporary_object);
133 static_cast<exprt &
>(function_call.
add(ID_initializer));
135 assert(initializer.id()==ID_code
136 && initializer.get(ID_statement)==ID_expression);
141 exprt &tmp_this=func_ini.arguments().front();
142 assert(tmp_this.id()==ID_address_of
143 && tmp_this.op0().id()==
"new_object");
147 new_code.
swap(initializer);
side_effect_expr_function_callt & to_side_effect_expr_function_call(exprt &expr)
The type of an expression.
void typecheck_side_effect_function_call(side_effect_expr_function_callt &expr)
pointer_typet pointer_type(const typet &subtype)
void copy_to_operands(const exprt &expr)
std::vector< componentt > componentst
void move_to_operands(exprt &expr)
const componentst & components() const
static mstreamt & eom(mstreamt &m)
const irep_idt & id() const
const array_typet & to_array_type(const typet &type)
Cast a generic typet to an array_typet.
void elaborate_class_template(const typet &type)
elaborate class template instances
source_locationt source_location
bool cpp_is_pod(const typet &type) const
bool is_reference(const typet &type)
TO_BE_DOCUMENTED.
const irep_idt & get(const irep_namet &name) const
codet cpp_destructor(const source_locationt &source_location, const typet &type, const exprt &object)
const exprt & size() const
Base class for tree-like data structures with sharing.
C++ Language Type Checking.
bitvector_typet index_type()
Operator to return the address of an object.
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
cpp_scopet & set_scope(const irep_idt &identifier)
A function call side effect.
void follow_symbol(irept &irep) const
void set_statement(const irep_idt &statement)
Base class for all expressions.
virtual void make_constant_index(exprt &expr)
irept & add(const irep_namet &name)
virtual std::string to_string(const typet &type)
source_locationt & add_source_location()
A statement in a programming language.
const typet & subtype() const
const irept & find(const irep_namet &name) const