Go to the documentation of this file.
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",
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
virtual bvt convert_member(const member_exprt &expr)
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
The type of an expression, extends irept.
std::vector< literalt > bvt
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Base class for all expressions.
std::vector< componentt > componentst
bitvector_typet index_type()
irep_idt byte_extract_id()
typet & type()
Return the type of the expression.
Expression classes for byte-level operators.
boolbv_widtht boolbv_width
const std::string & id2string(const irep_idt &d)
#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...
bool base_type_eq(const typet &type1, const typet &type2, const namespacet &ns)
Check types for equality across all levels of hierarchy.
const exprt & struct_op() const
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
const irep_idt & id() const
virtual const bvt & convert_bv(const exprt &expr, const optionalt< std::size_t > expected_width=nullopt)
Extract member of struct or union.
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
irep_idt get_component_name() const