27 if(expr.
type().
id()==ID_vector)
30 expr.
id() == ID_plus || expr.
id() == ID_minus || expr.
id() == ID_mult ||
31 expr.
id() == ID_div || expr.
id() == ID_mod || expr.
id() == ID_bitxor ||
32 expr.
id() == ID_bitand || expr.
id() == ID_bitor || expr.
id() == ID_shl ||
33 expr.
id() == ID_lshr || expr.
id() == ID_ashr ||
34 expr.
id() == ID_saturating_minus || expr.
id() == ID_saturating_plus)
38 else if(expr.
id()==ID_unary_minus || expr.
id()==ID_bitnot)
41 expr.
id() == ID_vector_equal || expr.
id() == ID_vector_notequal ||
42 expr.
id() == ID_vector_lt || expr.
id() == ID_vector_le ||
43 expr.
id() == ID_vector_gt || expr.
id() == ID_vector_ge)
47 else if(expr.
id() == ID_shuffle_vector)
49 else if(expr.
id()==ID_vector)
56 for(
const auto &op : expr.
operands())
67 if(type.
id()==ID_struct || type.
id()==ID_union)
73 else if(type.
id() == ID_code)
85 else if(type.
id()==ID_pointer ||
86 type.
id()==ID_complex ||
89 else if(type.
id()==ID_vector)
103 if(expr.
id() == ID_shuffle_vector)
114 if(expr.
type().
id()==ID_vector)
117 expr.
id() == ID_plus || expr.
id() == ID_minus || expr.
id() == ID_mult ||
118 expr.
id() == ID_div || expr.
id() == ID_mod || expr.
id() == ID_bitxor ||
119 expr.
id() == ID_bitand || expr.
id() == ID_bitor || expr.
id() == ID_shl ||
120 expr.
id() == ID_lshr || expr.
id() == ID_ashr ||
121 expr.
id() == ID_saturating_minus || expr.
id() == ID_saturating_plus)
139 array_expr.
operands().resize(numeric_cast_v<std::size_t>(dimension));
142 for(std::size_t i=0; i<array_expr.operands().size(); i++)
154 else if(expr.
id()==ID_unary_minus || expr.
id()==ID_bitnot)
167 array_expr.
operands().resize(numeric_cast_v<std::size_t>(dimension));
170 for(std::size_t i=0; i<array_expr.operands().size(); i++)
175 unary_expr.id(),
index_exprt(unary_expr.op(), index, subtype));
181 expr.
id() == ID_vector_equal || expr.
id() == ID_vector_notequal ||
182 expr.
id() == ID_vector_lt || expr.
id() == ID_vector_le ||
183 expr.
id() == ID_vector_gt || expr.
id() == ID_vector_ge)
190 const auto dimension = numeric_cast_v<std::size_t>(vector_type.
size());
197 operands.reserve(dimension);
199 const bool is_float =
203 if(binary_expr.id() == ID_vector_notequal)
206 new_id = ID_ieee_float_notequal;
208 new_id = ID_notequal;
210 else if(binary_expr.id() == ID_vector_equal)
213 new_id = ID_ieee_float_equal;
220 new_id =
id2string(binary_expr.id()).substr(7);
223 for(std::size_t i = 0; i < dimension; ++i)
240 else if(expr.
id()==ID_vector)
244 else if(expr.
id() == ID_typecast)
248 if(op.type().id() != ID_array)
253 const auto dimension =
262 expr.
type().
id() == ID_vector &&
269 const std::size_t dimension =
274 elements.reserve(dimension);
276 for(std::size_t i = 0; i < dimension; i++)
283 array_exprt array_expr(std::move(elements), array_type);
285 expr.
swap(array_expr);
299 if(type.
id()==ID_struct || type.
id()==ID_union)
304 for(struct_union_typet::componentst::iterator
312 else if(type.
id() == ID_code)
320 else if(type.
id()==ID_pointer ||
321 type.
id()==ID_complex ||
326 else if(type.
id()==ID_vector)
349 for(
auto it = symbol_table.
begin(); it != symbol_table.
end(); ++it)
356 for(
auto &i : goto_function.body.instructions)
357 i.transform([](
exprt e) -> std::optional<exprt> {
393 for(
auto &instruction : function_it.second.body.instructions)
API to expression classes that are internal to the C frontend.
const shuffle_vector_exprt & to_shuffle_vector_expr(const exprt &expr)
Cast an exprt to a shuffle_vector_exprt.
Array constructor from list of elements.
const typet & element_type() const
The type of the elements of the array.
const exprt & size() const
A base class for binary expressions.
A base class for relations, i.e., binary predicates whose two operands have the same type.
const typet & return_type() const
const parameterst & parameters() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
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.
The trinary if-then-else operator.
const irep_idt & id() const
vector_exprt lower() const
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.
Semantic type conversion.
static exprt conditional_cast(const exprt &expr, const typet &type)
The type of an expression, extends irept.
const source_locationt & source_location() const
source_locationt & add_source_location()
Generic base class for unary expressions.
const constant_exprt & size() const
const typet & element_type() const
The type of the elements of the vector.
#define Forall_operands(it, expr)
const std::string & id2string(const irep_idt &d)
static void remove_vector(typet &)
removes vector data type
static bool have_to_remove_vector(const typet &type)
bool has_vector(const goto_functionst &goto_functions)
returns true iff any of the given goto functions has instructions that use the vector type
Remove the 'vector' data type by compilation into arrays.
#define PRECONDITION(CONDITION)
API to expression classes.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
const vector_typet & to_vector_type(const typet &type)
Cast a typet to a vector_typet.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_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)