31 if(
object.type().
id() == ID_array)
35 if(size_expr.
id() == ID_infinity)
38 exprt tmp_size=size_expr;
45 error() <<
"array size '" <<
to_string(size_expr) <<
"' is not a constant"
63 if(i_code.has_value())
67 return std::move(new_code);
84 for(
const auto &c : components)
86 const typet &type = c.type();
89 !c.get_bool(ID_from_base) && type.
id() == ID_code &&
92 dtor_name = c.get_base_name();
97 INVARIANT(!dtor_name.
empty(),
"non-PODs should have a destructor");
99 cpp_namet cpp_name(dtor_name, source_location);
101 exprt member(ID_member);
102 member.
add(ID_component_cpp_name) = cpp_name;
114 return std::move(new_code);
bitvector_typet c_index_type()
static void make_already_typechecked(exprt &expr)
const exprt & size() const
virtual void make_constant_index(exprt &expr)
A codet representing sequential composition of program statements.
codet representation of an expression statement.
cpp_scopet & set_scope(const irep_idt &identifier)
void typecheck_side_effect_function_call(side_effect_expr_function_callt &) override
bool cpp_is_pod(const typet &type) const
void elaborate_class_template(const typet &type)
elaborate class template instances
std::optional< codet > cpp_destructor(const source_locationt &source_location, const exprt &object)
std::string to_string(const typet &) override
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
void copy_to_operands(const exprt &expr)
Copy the given argument to the end of exprt's operands.
source_locationt & add_source_location()
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
const irep_idt & id() const
irept & add(const irep_idt &name)
source_locationt source_location
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A side_effect_exprt representation of a function call side effect.
Structure type, corresponds to C style structs.
const componentst & components() const
std::vector< componentt > componentst
The type of an expression, extends irept.
C++ Language Type Checking.
bool is_reference(const typet &type)
Returns true if the type is a reference.
#define CHECK_RETURN(CONDITION)
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.