Go to the documentation of this file.
22 std::size_t offset = 0;
24 for(
const auto &c : components)
26 const typet &subtype = c.type();
29 if(c.get_name() == component_name)
32 subtype == expr.
type(),
33 "component type shall match the member expression type",
37 offset + sub_width <= struct_bv.size(),
38 "bitvector part corresponding to element shall be contained within the "
39 "full aggregate bitvector");
42 struct_bv.begin() + offset, struct_bv.begin() + offset + sub_width);
45 if(struct_op_type.
id() != ID_union)
51 "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_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_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
#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...
typet & type()
Return the type of the expression.
boolbv_widtht boolbv_width
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const std::string & id2string(const irep_idt &d)
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)
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
Extract member of struct or union.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
irep_idt get_component_name() const