40 if(tmp_type.
id()==ID_array)
42 const exprt &size_expr=
45 if(size_expr.
id()==
"infinity")
52 exprt tmp_size=size_expr;
60 <<
"' is not a constant" <<
eom;
64 new_code.
type().
id(ID_code);
98 for(struct_typet::componentst::const_iterator
99 it=components.begin();
100 it!=components.end();
103 const typet &type=it->type();
105 if(!it->get_bool(ID_from_base) &&
106 type.
id()==ID_code &&
107 type.
find(ID_return_type).
id()==ID_destructor)
109 dtor_name=it->get(ID_base_name);
115 assert(dtor_name!=
"");
117 irept cpp_name(ID_cpp_name);
119 cpp_name.
get_sub().back().set(ID_identifier, dtor_name);
120 cpp_name.
get_sub().back().set(ID_C_source_location, source_location);
124 function_call.
function().
swap(static_cast<exprt&>(cpp_name));
127 assert(function_call.
get(ID_statement)==ID_temporary_object);
130 static_cast<exprt &
>(function_call.
add(ID_initializer));
132 assert(initializer.id()==ID_code
133 && initializer.get(ID_statement)==ID_expression);
138 exprt &tmp_this=func_ini.arguments().front();
139 assert(tmp_this.id()==ID_address_of
140 && tmp_this.op0().id()==
"new_object");
144 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)
std::vector< componentt > componentst
void move_to_operands(exprt &expr)
const componentst & components() const
static mstreamt & eom(mstreamt &m)
const irep_idt & id() const
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.
const typet & follow(const typet &) const
bitvector_typet index_type()
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
Operator to return the address of an object.
cpp_scopet & set_scope(const irep_idt &identifier)
A function call side effect.
void set_statement(const irep_idt &statement)
const array_typet & to_array_type(const typet &type)
Cast a generic typet to an array_typet.
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