Go to the documentation of this file.
22 expr.
operands().size() == components.size(),
23 "number of operands of a struct expression shall equal the number of"
24 "components as indicated by its type",
30 std::size_t bit_idx = 0;
32 exprt::operandst::const_iterator op_it=expr.
operands().begin();
33 for(
const auto &comp : components)
35 const typet &subtype=comp.type();
36 const exprt &op=*op_it;
40 "type of a struct expression operand shall equal the type of the "
41 "corresponding struct component",
53 bit_idx + op_bv.size() <= width,
"bit index shall be within bounds");
55 for(
const auto &bit : op_bv)
66 bit_idx == width,
"all bits in the bitvector shall have been assigned");
const componentst & components() const
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
Struct constructor from list of elements.
typet & type()
Return the type of the expression.
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
virtual std::size_t boolbv_width(const typet &type) const
virtual const bvt & convert_bv(const exprt &expr, const optionalt< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
Structure type, corresponds to C style structs.
virtual bvt convert_struct(const struct_exprt &expr)
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.