24 if(expr.
id()==ID_struct && expr.
operands().size()==2)
46 if(expr.
id()==ID_typecast &&
48 expr.
type().
id()!=ID_complex)
51 if(expr.
type().
id()==ID_complex)
53 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
54 expr.
id()==ID_mult || expr.
id()==ID_div)
56 else if(expr.
id()==ID_unary_minus)
58 else if(expr.
id()==ID_complex)
60 else if(expr.
id()==ID_typecast)
64 if(expr.
id()==ID_complex_real)
66 else if(expr.
id()==ID_complex_imag)
81 if(type.
id()==ID_struct || type.
id()==ID_union)
87 else if(type.
id()==ID_pointer ||
88 type.
id()==ID_vector ||
91 else if(type.
id()==ID_complex)
105 if(expr.
id()==ID_typecast)
108 if(typecast_expr.op().type().id() == ID_complex)
110 if(typecast_expr.type().id() == ID_complex)
127 if(expr.
type().
id()==ID_complex)
129 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
130 expr.
id()==ID_mult || expr.
id()==ID_div)
155 else if(expr.
id()==ID_unary_minus)
163 unary_minus_expr.
type());
166 unary_minus_expr.source_location();
168 struct_expr.op1().add_source_location() =
169 unary_minus_expr.source_location();
173 else if(expr.
id()==ID_complex)
177 {complex_expr.real(), complex_expr.imag()}, complex_expr.type());
178 struct_expr.add_source_location() = complex_expr.source_location();
179 expr.
swap(struct_expr);
181 else if(expr.
id()==ID_typecast)
186 if(typecast_expr.op().type().id() == ID_struct)
194 typecast_expr.
type());
197 typecast_expr.source_location();
199 struct_expr.op1().add_source_location() =
200 typecast_expr.source_location();
210 typecast_expr.
type());
218 if(expr.
id()==ID_complex_real)
222 else if(expr.
id()==ID_complex_imag)
236 if(type.
id()==ID_struct || type.
id()==ID_union)
240 for(struct_union_typet::componentst::iterator
248 else if(type.
id()==ID_pointer ||
249 type.
id()==ID_vector ||
254 else if(type.
id()==ID_complex)
264 type = std::move(struct_type);
278 for(
const auto &named_symbol : symbol_table.
symbols)
286 for(
auto &i : goto_function.body.instructions)
A base class for binary expressions.
Real part of the expression describing a complex number.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
source_locationt & add_source_location()
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
A collection of goto functions.
function_mapt function_map
::goto_functiont goto_functiont
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
const irep_idt & id() const
Extract member of struct or union.
Struct constructor from list of elements.
Structure type, corresponds to C style structs.
Base type for structs and unions.
const componentst & components() const
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
typet type
Type of symbol.
exprt value
Initial value of symbol.
Semantic type conversion.
The type of an expression, extends irept.
const source_locationt & source_location() const
const typet & subtype() const
source_locationt & add_source_location()
The unary minus expression.
#define forall_operands(it, expr)
#define Forall_operands(it, expr)
nonstd::optional< T > optionalt
static void remove_complex(typet &)
removes complex data type
static bool have_to_remove_complex(const typet &type)
static exprt complex_member(const exprt &expr, irep_idt id)
Remove the 'complex' data type by compilation into structs.
#define UNREACHABLE
This should be used to mark dead code.
#define PRECONDITION(CONDITION)
API to expression classes.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const complex_real_exprt & to_complex_real_expr(const exprt &expr)
Cast an exprt to a complex_real_exprt.
const unary_minus_exprt & to_unary_minus_expr(const exprt &expr)
Cast an exprt to a unary_minus_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
const complex_exprt & to_complex_expr(const exprt &expr)
Cast an exprt to a complex_exprt.
const complex_imag_exprt & to_complex_imag_expr(const exprt &expr)
Cast an exprt to a complex_imag_exprt.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.