69 result = std::max(result,
alignment(
c.type(), ns));
104static std::optional<std::size_t>
139 struct_typet::componentst::iterator where,
146 "$bit_field_pad" + std::to_string(where - components.begin()),
151 return std::next(components.insert(where,
component));
154static struct_typet::componentst::iterator
pad(
156 struct_typet::componentst::iterator where,
162 "$pad" + std::to_string(where - components.begin()),
167 return std::next(components.insert(where,
component));
154static struct_typet::componentst::iterator
pad( {
…}
179 for(struct_typet::componentst::iterator it = components.begin();
180 it != components.end();
244 else if(it->is_boolean())
253 if(size.has_value() && *size >= 1)
263 const std::size_t
pad =
294 for(struct_typet::componentst::iterator
295 it=components.begin();
296 it!=components.end();
306 else if(it->is_boolean())
327 const std::size_t
pad =
338 for(struct_typet::componentst::iterator
339 it=components.begin();
340 it!=components.end();
385 bit_field_bits == 0,
"padding ensures offset at byte boundaries");
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a typet to a c_bit_field_typet.
const c_enum_typet & to_c_enum_type(const typet &type)
Cast a typet to a c_enum_typet.
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Type for C bit fields These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (...
const typet & underlying_type() const
struct configt::ansi_ct ansi_c
Base class for all expressions.
bool get_bool(const irep_idt &name) const
const irept & find(const irep_idt &name) const
const irep_idt & id() 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 componentst & components() const
std::vector< componentt > componentst
The type of an expression, extends irept.
Fixed-width bit-vector with unsigned binary interpretation.
static std::optional< std::size_t > underlying_width(const c_bit_field_typet &type, const namespacet &ns)
mp_integer alignment(const typet &type, const namespacet &ns)
static void add_padding_msvc(struct_typet &type, const namespacet &ns)
static void add_padding_gcc(struct_typet &type, const namespacet &ns)
void add_padding(struct_typet &type, const namespacet &ns)
static struct_typet::componentst::iterator pad(struct_typet::componentst &components, struct_typet::componentst::iterator where, std::size_t pad_bits)
static struct_typet::componentst::iterator pad_bit_field(struct_typet::componentst &components, struct_typet::componentst::iterator where, std::size_t pad_bits)
ANSI-C Language Type Checking.
std::optional< mp_integer > pointer_offset_size(const typet &type, const namespacet &ns)
Compute the size of a type in bytes, rounding up to full bytes.
std::optional< mp_integer > pointer_offset_bits(const typet &type, const namespacet &ns)
exprt simplify_expr(exprt src, const namespacet &ns)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.