23 if(struct_op_type.
id()==ID_union)
34 struct_op_type.
id() == ID_struct,
35 "member_exprt should denote access to a union or struct");
43 for(
const auto &c : components)
45 const typet &subtype = c.type();
48 if(c.get_name() == component_name)
52 "struct component type shall match the member expression type",
59 offset + sub_width <= struct_bv.size(),
60 "bitvector part corresponding to struct element shall be contained " 61 "within the full struct bitvector");
63 for(std::size_t i=0; i<sub_width; i++)
64 bv[i]=struct_bv[offset+i];
74 "struct type shall contain component accessed by member expression",
The type of an expression, extends irept.
const std::string & id2string(const irep_idt &d)
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
bool base_type_eq(const typet &type1, const typet &type2, const namespacet &ns)
Check types for equality across all levels of hierarchy.
boolbv_widtht boolbv_width
std::vector< componentt > componentst
const componentst & components() const
typet & type()
Return the type of the expression.
virtual const bvt & convert_bv(const exprt &expr, const optionalt< std::size_t > expected_width=nullopt)
Extract member of struct or union.
const irep_idt & id() const
Expression classes for byte-level operators.
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
bitvector_typet index_type()
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
Base class for all expressions.
const exprt & struct_op() const
irep_idt get_component_name() const
virtual bvt convert_member(const member_exprt &expr)
#define INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
Same as invariant, with one or more diagnostics attached Diagnostics can be of any type that has a sp...
std::vector< literalt > bvt
irep_idt byte_extract_id()