20 if(expr.
id()==ID_struct && expr.
operands().size()==2)
31 assert(expr.
type().
id()==ID_struct);
34 assert(struct_type.components().size()==2);
43 if(expr.
id()==ID_typecast &&
45 expr.
type().
id()!=ID_complex)
48 if(expr.
type().
id()==ID_complex)
50 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
51 expr.
id()==ID_mult || expr.
id()==ID_div)
53 else if(expr.
id()==ID_unary_minus)
55 else if(expr.
id()==ID_complex)
57 else if(expr.
id()==ID_typecast)
61 if(expr.
id()==ID_complex_real)
63 else if(expr.
id()==ID_complex_imag)
78 if(type.
id()==ID_struct || type.
id()==ID_union)
82 for(struct_union_typet::componentst::const_iterator
89 else if(type.
id()==ID_pointer ||
90 type.
id()==ID_vector ||
93 else if(type.
id()==ID_complex)
107 if(expr.
id()==ID_typecast)
112 if(expr.
type().
id()==ID_complex)
130 if(expr.
type().
id()==ID_complex)
132 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
133 expr.
id()==ID_mult || expr.
id()==ID_div)
155 else if(expr.
id()==ID_unary_minus)
175 else if(expr.
id()==ID_complex)
180 else if(expr.
id()==ID_typecast)
219 if(expr.
id()==ID_complex_real)
224 else if(expr.
id()==ID_complex_imag)
239 if(type.
id()==ID_struct || type.
id()==ID_union)
243 for(struct_union_typet::componentst::iterator
251 else if(type.
id()==ID_pointer ||
252 type.
id()==ID_vector ||
257 else if(type.
id()==ID_complex)
265 struct_type.components().resize(2);
266 struct_type.components()[0].type()=type.
subtype();
267 struct_type.components()[0].set_name(ID_real);
268 struct_type.components()[1].type()=type.
subtype();
269 struct_type.components()[1].set_name(ID_imag);
The type of an expression.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast a generic exprt to a typecast_exprt.
Remove the 'complex' data type by compilation into structs.
exprt value
Initial value of symbol.
const componentst & components() const
static exprt complex_member(const exprt &expr, irep_idt id)
symbol_tablet symbol_table
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
Extract member of struct or union.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a generic typet to a struct_union_typet.
#define Forall_symbols(it, expr)
const irep_idt & id() const
A generic base class for binary expressions.
Generic base class for unary expressions.
#define forall_operands(it, expr)
goto_function_templatet< goto_programt > goto_functiont
The unary minus expression.
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
const source_locationt & source_location() const
typet type
Type of symbol.
Base type of C structs and unions, and C++ classes.
Base class for all expressions.
source_locationt & add_source_location()
#define Forall_goto_functions(it, functions)
const source_locationt & source_location() const
static bool have_to_remove_complex(const typet &type)
#define Forall_operands(it, expr)
#define Forall_goto_program_instructions(it, program)
static void remove_complex(typet &)
removes complex data type
const typet & subtype() const
struct constructor from list of elements
goto_functionst goto_functions