Go to the documentation of this file.
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)
80 if(type.
id()==ID_struct || type.
id()==ID_union)
86 else if(type.
id()==ID_pointer ||
87 type.
id()==ID_vector ||
90 else if(type.
id()==ID_complex)
104 if(expr.
id()==ID_typecast)
107 if(typecast_expr.op().type().id() == ID_complex)
109 if(typecast_expr.type().id() == ID_complex)
126 if(expr.
type().
id()==ID_complex)
128 if(expr.
id()==ID_plus || expr.
id()==ID_minus ||
129 expr.
id()==ID_mult || expr.
id()==ID_div)
154 else if(expr.
id()==ID_unary_minus)
162 unary_minus_expr.
type());
165 unary_minus_expr.source_location();
167 struct_expr.op1().add_source_location() =
168 unary_minus_expr.source_location();
172 else if(expr.
id()==ID_complex)
176 {complex_expr.real(), complex_expr.imag()}, complex_expr.type());
177 struct_expr.add_source_location() = complex_expr.source_location();
178 expr.
swap(struct_expr);
180 else if(expr.
id()==ID_typecast)
185 if(typecast_expr.op().type().id() == ID_struct)
193 typecast_expr.
type());
196 typecast_expr.source_location();
198 struct_expr.op1().add_source_location() =
199 typecast_expr.source_location();
209 typecast_expr.
type());
217 if(expr.
id()==ID_complex_real)
221 else if(expr.
id()==ID_complex_imag)
235 if(type.
id()==ID_struct || type.
id()==ID_union)
239 for(struct_union_typet::componentst::iterator
247 else if(type.
id()==ID_pointer ||
248 type.
id()==ID_vector ||
253 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)
#define UNREACHABLE
This should be used to mark dead code.
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
#define Forall_operands(it, expr)
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.
The type of an expression, extends irept.
Base type for structs and unions.
typet type
Type of symbol.
Real part of the expression describing a complex number.
const type_with_subtypet & to_type_with_subtype(const typet &type)
Base class for all expressions.
const complex_exprt & to_complex_expr(const exprt &expr)
Cast an exprt to a complex_exprt.
A base class for binary expressions.
function_mapt function_map
const complex_typet & to_complex_type(const typet &type)
Cast a typet to a complex_typet.
const complex_real_exprt & to_complex_real_expr(const exprt &expr)
Cast an exprt to a complex_real_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
Struct constructor from list of elements.
typet & type()
Return the type of the expression.
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
#define forall_operands(it, expr)
#define PRECONDITION(CONDITION)
const source_locationt & source_location() const
static exprt complex_member(const exprt &expr, irep_idt id)
const unary_minus_exprt & to_unary_minus_expr(const exprt &expr)
Cast an exprt to a unary_minus_exprt.
static bool have_to_remove_complex(const typet &type)
The unary minus expression.
const irep_idt & id() const
source_locationt & add_source_location()
const complex_imag_exprt & to_complex_imag_expr(const exprt &expr)
Cast an exprt to a complex_imag_exprt.
nonstd::optional< T > optionalt
static void remove_complex(typet &)
removes complex data type
::goto_functiont goto_functiont
Extract member of struct or union.
A collection of goto functions.
exprt value
Initial value of symbol.
Structure type, corresponds to C style structs.
goto_functionst goto_functions
GOTO functions.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
const typet & subtype() const
source_locationt & add_source_location()
Semantic type conversion.
const source_locationt & source_location() const
symbol_tablet symbol_table
Symbol table.