23 union_op.
type().
id() == ID_union_tag
32 "union type shall contain component accessed by member expression",
37 const std::size_t sub_width = boolbv.
boolbv_width(subtype);
43 for(std::size_t i = 0; i < sub_width; ++i)
55 if(compound_type.
id() == ID_struct_tag || compound_type.
id() == ID_struct)
58 compound_type.
id() == ID_struct_tag
62 const auto &member_bits =
66 member_bits.offset + member_bits.width <= compound_bv.size(),
67 "bitvector part corresponding to element shall be contained within the "
68 "full aggregate bitvector");
71 compound_bv.begin() + member_bits.offset,
72 compound_bv.begin() + member_bits.offset + member_bits.width);
77 compound_type.
id() == ID_union_tag || compound_type.
id() == ID_union);
static bvt convert_member_union(const member_exprt &expr, const bvt &union_bv, const boolbvt &boolbv, const namespacet &ns)
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
const union_typet & to_union_type(const typet &type)
Cast a typet to a union_typet.
const membert & get_member(const struct_typet &type, const irep_idt &member) const
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 bvt convert_member(const member_exprt &expr)
virtual endianness_mapt endianness_map(const typet &type, bool little_endian) const
virtual std::size_t boolbv_width(const typet &type) const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Maps a big-endian offset to a little-endian offset.
size_t map_bit(size_t bit) const
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.
const irep_idt & id() const
Extract member of struct or union.
const exprt & compound() const
irep_idt get_component_name() const
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Structure type, corresponds to C style structs.
const componentt & get_component(const irep_idt &component_name) const
Get the reference to a component with given name.
The type of an expression, extends irept.
const std::string & id2string(const irep_idt &d)
std::vector< literalt > bvt
#define PRECONDITION(CONDITION)
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
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.