16 expr.
type().
id() == ID_struct_tag
25 expr.
operands().size() == components.size(),
26 "number of operands of a struct expression shall equal the number of"
27 "components as indicated by its type",
33 std::size_t bit_idx = 0;
35 exprt::operandst::const_iterator op_it=expr.
operands().begin();
36 for(
const auto &comp : components)
38 const typet &subtype=comp.type();
39 const exprt &op=*op_it;
43 "type of a struct expression operand shall equal the type of the "
44 "corresponding struct component",
56 bit_idx + op_bv.size() <= width,
"bit index shall be within bounds");
58 for(
const auto &bit : op_bv)
69 bit_idx == width,
"all bits in the bitvector shall have been assigned");
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
virtual std::size_t boolbv_width(const typet &type) const
virtual bvt convert_struct(const struct_exprt &expr)
Base class for all expressions.
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
typet & type()
Return the type of the expression.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irep_idt & id() const
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
Struct constructor from list of elements.
Structure type, corresponds to C style structs.
const componentst & components() const
std::vector< componentt > componentst
The type of an expression, extends irept.
std::vector< literalt > bvt
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.