18 const exprt &struct_union,
25 if(struct_union.
get_bool(ID_C_lvalue))
26 result.
set(ID_C_lvalue,
true);
35 result.type().
set(ID_C_constant,
true);
42 const exprt &struct_union,
52 for(
const auto &comp : components)
56 if(comp.get_name()==component_name)
60 else if(comp.get_anonymous() &&
61 (type.
id()==ID_struct || type.
id()==ID_union))
84 for(
const auto &comp : components)
86 if(comp.get_name()==component_name)
90 else if(comp.get_anonymous())
The type of an expression, extends irept.
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
std::vector< componentt > componentst
const componentst & components() const
bool has_component_rec(const typet &type, const irep_idt &component_name, const namespacet &ns)
typet & type()
Return the type of the expression.
bool get_bool(const irep_namet &name) const
static member_exprt make_member_expr(const exprt &struct_union, const struct_union_typet::componentt &component, const namespacet &ns)
exprt get_component_rec(const exprt &struct_union, const irep_idt &component_name, const namespacet &ns)
Extract member of struct or union.
const irep_idt & id() const
API to expression classes.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
Base type for structs and unions.
Base class for all expressions.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
void set(const irep_namet &name, const irep_idt &value)
C Language Type Checking.