25 if(expr.
id()==ID_member)
29 if(op.
type().
id() == ID_union_tag || op.
type().
id() == ID_union)
32 else if(expr.
id()==ID_union)
35 for(
const auto &op : expr.
operands())
51 if(expr.
id()==ID_index)
56 else if(expr.
id()==ID_member)
58 else if(expr.
id()==ID_symbol)
62 else if(expr.
id()==ID_dereference)
70 if(expr.
id()==ID_address_of)
82 if(expr.
id()==ID_member)
86 if(op.
type().
id() == ID_union_tag || op.
type().
id() == ID_union)
92 else if(expr.
id()==ID_union)
103 for(
auto &instruction : goto_function.body.instructions)
107 if(instruction.has_condition())
130 bool unmodified =
true;
136 expr.
id() == ID_byte_extract_little_endian ||
137 expr.
id() == ID_byte_extract_big_endian)
147 for(
const auto &comp : union_type.
components())
155 comp.type().id() == ID_array || comp.type().id() == ID_struct ||
156 comp.type().id() == ID_struct_tag)
163 if(result.has_value())
byte_update_exprt make_byte_update(const exprt &_op, const exprt &_offset, const exprt &_value)
Construct a byte_update_exprt with endianness and byte width matching the current configuration.
byte_extract_exprt make_byte_extract(const exprt &_op, const exprt &_offset, const typet &_type)
Construct a byte_extract_exprt with endianness and byte width matching the current configuration.
Expression classes for byte-level operators.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
bitvector_typet c_index_type()
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.
Base class for all expressions.
const source_locationt & source_location() const
bool is_zero() const
Return whether the expression is a constant representing 0.
typet & type()
Return the type of the expression.
A collection of goto functions.
function_mapt function_map
::goto_functiont goto_functiont
goto_functionst goto_functions
GOTO functions.
const irep_idt & id() const
Extract member of struct or union.
const exprt & struct_op() 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...
A side_effect_exprt that returns a non-deterministically chosen value.
const componentst & components() const
Union constructor from single element.
#define Forall_operands(it, expr)
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
std::optional< exprt > get_subexpression_at_offset(const exprt &expr, const mp_integer &offset_bytes, const typet &target_type_raw, const namespacet &ns)
void restore_union(exprt &expr, const namespacet &ns)
Undo the union access -> byte_extract replacement that rewrite_union did for the purpose of displayin...
static bool have_to_rewrite_union(const exprt &expr)
void rewrite_union_address_of(exprt &expr)
void rewrite_union(exprt &expr)
We rewrite u.c for unions u into byte_extract(u, 0), and { .c = v } into byte_update(NIL,...
static bool restore_union_rec(exprt &expr, const namespacet &ns)
Undo the union access -> byte_extract replacement that rewrite_union did for the purpose of displayin...
const union_exprt & to_union_expr(const exprt &expr)
Cast an exprt to a union_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.