23 if(expr.
id()==ID_struct && expr.
operands().size()==2)
45 if(expr.
id()==ID_typecast &&
47 expr.
type().
id()!=ID_complex)
50 if(expr.
type().
id()==ID_complex)
52 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
53 expr.
id()==ID_mult || expr.
id()==ID_div)
55 else if(expr.
id()==ID_unary_minus)
57 else if(expr.
id()==ID_complex)
59 else if(expr.
id()==ID_typecast)
63 if(expr.
id()==ID_complex_real)
65 else if(expr.
id()==ID_complex_imag)
71 for(
const auto &op : expr.
operands())
82 if(type.
id()==ID_struct || type.
id()==ID_union)
88 else if(type.
id()==ID_pointer ||
89 type.
id()==ID_vector ||
92 else if(type.
id()==ID_complex)
106 if(expr.
id()==ID_typecast)
109 if(typecast_expr.op().type().id() == ID_complex)
111 if(typecast_expr.type().id() == ID_complex)
128 if(expr.
type().
id()==ID_complex)
130 if(expr.
id() == ID_plus || expr.
id() == ID_minus)
153 else if(expr.
id() == ID_mult)
175 else if(expr.
id() == ID_div)
200 else if(expr.
id()==ID_unary_minus)
208 unary_minus_expr.
type());
211 unary_minus_expr.source_location();
213 struct_expr.op1().add_source_location() =
214 unary_minus_expr.source_location();
218 else if(expr.
id()==ID_complex)
222 {complex_expr.real(), complex_expr.imag()}, complex_expr.type());
223 struct_expr.add_source_location() = complex_expr.source_location();
224 expr.
swap(struct_expr);
226 else if(expr.
id()==ID_typecast)
231 if(typecast_expr.op().type().id() == ID_struct)
239 typecast_expr.
type());
242 typecast_expr.source_location();
244 struct_expr.op1().add_source_location() =
245 typecast_expr.source_location();
255 typecast_expr.
type());
263 if(expr.
id()==ID_complex_real)
267 else if(expr.
id()==ID_complex_imag)
281 if(type.
id()==ID_struct || type.
id()==ID_union)
285 for(struct_union_typet::componentst::iterator
293 else if(type.
id()==ID_pointer ||
294 type.
id()==ID_vector ||
299 else if(type.
id()==ID_complex)
310 type = std::move(struct_type);
324 for(
auto it = symbol_table.
begin(); it != symbol_table.
end(); ++it)
332 for(
auto &i : goto_function.body.instructions)
333 i.transform([](
exprt e) -> std::optional<exprt> {
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.
Binary multiplication Associativity is not specified.
The plus expression Associativity is not specified.
Struct constructor from list of elements.
Structure type, corresponds to C style structs.
Base type for structs and unions.
const componentst & components() const
The symbol table base class interface.
virtual iteratort begin()=0
virtual iteratort end()=0
typet type
Type of symbol.
exprt value
Initial value of symbol.
const typet & subtype() const
Semantic type conversion.
The type of an expression, extends irept.
const source_locationt & source_location() const
source_locationt & add_source_location()
The unary minus expression.
#define Forall_operands(it, expr)
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 complex_typet & to_complex_type(const typet &type)
Cast a typet to a complex_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const type_with_subtypet & to_type_with_subtype(const typet &type)