Go to the documentation of this file.
34 INVARIANT(!components.empty(),
"class structs cannot be empty");
36 const auto &first_member_name=components.front().get_name();
40 components.front().
type());
45 return std::move(member_expr);
58 const exprt &this_expr_in,
67 exprt this_expr=this_expr_in;
91 if(components.empty())
99 expr.
op0().
id()==ID_constant,
"@class_identifier must be a constant");
106 expr.
op0().
id()==ID_struct,
"Non @class_identifier must be a structure");
const irep_idt & get_identifier() const
const componentst & components() const
#define JAVA_CLASS_IDENTIFIER_FIELD_NAME
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
The type of an expression, extends irept.
Operator to dereference a pointer.
exprt get_class_identifier_field(const exprt &this_expr_in, const struct_tag_typet &suggested_type, const namespacet &ns)
Base class for all expressions.
std::vector< componentt > componentst
A struct tag type, i.e., struct_typet with an identifier.
Struct constructor from list of elements.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
void set_class_identifier(struct_exprt &expr, const namespacet &ns, const struct_tag_typet &class_type)
If expr has its components filled in then sets the @class_identifier member of the struct.
#define PRECONDITION(CONDITION)
static exprt build_class_identifier(const exprt &src, const namespacet &ns)
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
pointer_typet pointer_type(const typet &subtype)
const irep_idt & id() const
Extract member of struct or union.
Structure type, corresponds to C style structs.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const typet & base_type() const
The type of the data what we point to.
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Semantic type conversion.
A constant literal expression.
const struct_exprt & to_struct_expr(const exprt &expr)
Cast an exprt to a struct_exprt.