24 if(expr.
id()==ID_struct && expr.
operands().size()==2)
35 assert(expr.
type().
id()==ID_struct);
38 assert(struct_type.components().size()==2);
47 if(expr.
id()==ID_typecast &&
49 expr.
type().
id()!=ID_complex)
52 if(expr.
type().
id()==ID_complex)
54 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
55 expr.
id()==ID_mult || expr.
id()==ID_div)
57 else if(expr.
id()==ID_unary_minus)
59 else if(expr.
id()==ID_complex)
61 else if(expr.
id()==ID_typecast)
65 if(expr.
id()==ID_complex_real)
67 else if(expr.
id()==ID_complex_imag)
82 if(type.
id()==ID_struct || type.
id()==ID_union)
86 for(struct_union_typet::componentst::const_iterator
93 else if(type.
id()==ID_pointer ||
94 type.
id()==ID_vector ||
97 else if(type.
id()==ID_complex)
111 if(expr.
id()==ID_typecast)
116 if(expr.
type().
id()==ID_complex)
134 if(expr.
type().
id()==ID_complex)
136 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
137 expr.
id()==ID_mult || expr.
id()==ID_div)
159 else if(expr.
id()==ID_unary_minus)
179 else if(expr.
id()==ID_complex)
184 else if(expr.
id()==ID_typecast)
223 if(expr.
id()==ID_complex_real)
228 else if(expr.
id()==ID_complex_imag)
243 if(type.
id()==ID_struct || type.
id()==ID_union)
247 for(struct_union_typet::componentst::iterator
255 else if(type.
id()==ID_pointer ||
256 type.
id()==ID_vector ||
261 else if(type.
id()==ID_complex)
269 struct_type.components().resize(2);
270 struct_type.components()[0].type()=type.
subtype();
271 struct_type.components()[0].set_name(ID_real);
272 struct_type.components()[1].type()=type.
subtype();
273 struct_type.components()[1].set_name(ID_imag);
289 for(
const auto &named_symbol : symbol_table.
symbols)
The type of an expression.
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.
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.
virtual symbolt * get_writeable(const irep_idt &name) override
Find a symbol in the symbol table for read-write access.
const irep_idt & id() const
A generic base class for binary expressions.
API to expression classes.
Generic base class for unary expressions.
::goto_functiont goto_functiont
#define forall_operands(it, expr)
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
The unary minus expression.
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.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a generic typet to a struct_union_typet.
source_locationt & add_source_location()
#define Forall_goto_functions(it, functions)
const source_locationt & source_location() const
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast a generic exprt to a typecast_exprt.
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
GOTO functions.