Go to the documentation of this file.
29 "union type shall contain component accessed by member expression",
34 const std::size_t sub_width = boolbv.
boolbv_width(subtype);
40 for(std::size_t i = 0; i < sub_width; ++i)
52 if(compound_type.
id() == ID_struct_tag || compound_type.
id() == ID_struct)
55 compound_type.
id() == ID_struct_tag
59 const auto &member_bits =
63 member_bits.offset + member_bits.width <= compound_bv.size(),
64 "bitvector part corresponding to element shall be contained within the "
65 "full aggregate bitvector");
68 compound_bv.begin() + member_bits.offset,
69 compound_bv.begin() + member_bits.offset + member_bits.width);
74 compound_type.
id() == ID_union_tag || compound_type.
id() == ID_union);
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
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 componentt & get_component(const irep_idt &component_name) const
Get the reference to a component with given name.
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
Base class for all expressions.
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
#define DATA_INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
const std::string & id2string(const irep_idt &d)
virtual std::size_t boolbv_width(const typet &type) const
const exprt & compound() 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...
#define PRECONDITION(CONDITION)
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
size_t map_bit(size_t bit) const
const irep_idt & id() const
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
Extract member of struct or union.
Structure type, corresponds to C style structs.
Maps a big-endian offset to a little-endian offset.
irep_idt get_component_name() const
static bvt convert_member_union(const member_exprt &expr, const bvt &union_bv, const boolbvt &boolbv, const namespacet &ns)
virtual endianness_mapt endianness_map(const typet &type, bool little_endian) const
const membert & get_member(const struct_typet &type, const irep_idt &member) const