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;
92 if(components.empty())
106 expr.
op0().
id()==ID_struct,
"Non @class_identifier must be a structure");
pointer_typet pointer_type(const typet &subtype)
static exprt build_class_identifier(const exprt &src, const namespacet &ns)
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.
exprt get_class_identifier_field(const exprt &this_expr_in, const struct_tag_typet &suggested_type, const namespacet &ns)
Extract class identifier.
#define JAVA_CLASS_IDENTIFIER_FIELD_NAME
A constant literal expression.
Operator to dereference a pointer.
Base class for all expressions.
typet & type()
Return the type of the expression.
bool is_constant() const
Return whether the expression is a constant.
const irep_idt & id() const
Extract member of struct or union.
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const typet & base_type() const
The type of the data what we point to.
Struct constructor from list of elements.
A struct tag type, i.e., struct_typet with an identifier.
Structure type, corresponds to C style structs.
const componentst & components() const
std::vector< componentt > componentst
const irep_idt & get_identifier() const
Semantic type conversion.
API to expression classes for Pointers.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
API to expression classes.
const struct_exprt & to_struct_expr(const exprt &expr)
Cast an exprt to a struct_exprt.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.