33 assert(!components.empty());
35 const auto &first_member_name=components.front().get_name();
39 components.front().
type());
41 if(first_member_name==
"@class_identifier")
57 const exprt &this_expr_in,
65 exprt this_expr=this_expr_in;
66 assert(this_expr.
type().
id()==ID_pointer &&
67 "Non-pointer this-arg in remove-virtuals?");
91 if(components.empty())
96 if(components.front().get_name()==
"@class_identifier")
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");
The type of an expression.
pointer_typet pointer_type(const typet &subtype)
std::vector< componentt > componentst
const componentst & components() const
A constant literal expression.
void set_class_identifier(struct_exprt &expr, const namespacet &ns, const symbol_typet &class_type)
If expr has its components filled in then sets the @class_identifier member of the struct...
#define INVARIANT(CONDITION, REASON)
Extract member of struct or union.
const irep_idt & id() const
A reference into the symbol table.
Operator to dereference a pointer.
API to expression classes.
#define PRECONDITION(CONDITION)
const typet & follow(const typet &) const
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
static exprt build_class_identifier(const exprt &src, const namespacet &ns)
exprt get_class_identifier_field(const exprt &this_expr_in, const symbol_typet &suggested_type, const namespacet &ns)
const struct_exprt & to_struct_expr(const exprt &expr)
Cast a generic exprt to a struct_exprt.
Base class for all expressions.
Extract class identifier.
const typet & subtype() const
struct constructor from list of elements
const irep_idt & get_identifier() const