29 result.
name=
"location";
50 if(type.
id()==ID_symbol)
55 if(type.
id()==ID_unsignedbv)
57 result.
name=
"integer";
60 else if(type.
id()==ID_signedbv)
62 result.
name=
"integer";
65 else if(type.
id()==ID_floatbv)
70 else if(type.
id()==ID_bv)
72 result.
name=
"integer";
75 else if(type.
id()==ID_c_bit_field)
77 result.
name=
"integer";
80 else if(type.
id()==ID_c_enum_tag)
85 else if(type.
id()==ID_fixedbv)
90 else if(type.
id()==ID_pointer)
92 result.
name=
"pointer";
95 else if(type.
id()==ID_bool)
97 result.
name=
"boolean";
99 else if(type.
id()==ID_array)
104 else if(type.
id()==ID_vector)
106 result.
name=
"vector";
111 else if(type.
id()==ID_struct)
113 result.
name=
"struct";
116 for(
const auto &component : components)
123 else if(type.
id()==ID_union)
128 for(
const auto &component : components)
136 result.
name=
"unknown";
149 if(expr.
id()==ID_constant)
151 if(type.
id()==ID_unsignedbv ||
152 type.
id()==ID_signedbv ||
153 type.
id()==ID_c_bit_field)
157 result.
name=
"integer";
161 const typet &underlying_type=
162 type.
id()==ID_c_bit_field?type.
subtype():
167 std::string sig=
is_signed?
"":
"unsigned ";
184 else if(type.
id()==ID_c_enum)
186 result.
name=
"integer";
195 else if(type.
id()==ID_c_enum_tag)
202 else if(type.
id()==ID_bv)
204 result.
name=
"bitvector";
207 else if(type.
id()==ID_fixedbv)
214 else if(type.
id()==ID_floatbv)
221 else if(type.
id()==ID_pointer)
223 result.
name=
"pointer";
225 if(expr.
get(ID_value)==ID_NULL)
228 else if(type.
id()==ID_bool)
230 result.
name=
"boolean";
234 else if(type.
id()==ID_c_bool)
236 result.
name=
"integer";
245 result.
name=
"unknown";
248 else if(expr.
id()==ID_array)
262 else if(expr.
id()==ID_struct)
264 result.
name=
"struct";
267 if(type.
id()==ID_struct)
271 assert(components.size()==expr.
operands().size());
273 for(
unsigned m=0; m<expr.
operands().size(); m++)
281 else if(expr.
id()==ID_union)
294 result.
name=
"unknown";
The type of an expression.
bool is_signed(const typet &t)
Convenience function – is the type signed?
const typet & follow(const typet &src) const
struct configt::ansi_ct ansi_c
std::string to_ansi_c_string() const
const std::string & id2string(const irep_idt &d)
const std::string integer2string(const mp_integer &n, unsigned base)
const union_typet & to_union_type(const typet &type)
Cast a generic typet to a union_typet.
const irep_idt & get_function() const
std::vector< componentt > componentst
const componentst & components() const
A constant literal expression.
xmlt xml(const source_locationt &location)
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a generic typet to a floatbv_typet.
const irep_idt & get_column() const
const typet & follow_tag(const union_tag_typet &src) const
const irep_idt & id() const
void set_value(const irep_idt &value)
const irep_idt & get_line() const
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a generic typet to a c_enum_tag_typet.
unsigned long_long_int_width
API to expression classes.
void set_attribute(const std::string &attribute, unsigned value)
const irep_idt & get(const irep_namet &name) const
#define forall_operands(it, expr)
const union_exprt & to_union_expr(const exprt &expr)
Cast a generic exprt to a union_exprt.
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a generic typet to a c_bit_field_typet.
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a generic typet to an unsignedbv_typet.
std::size_t get_width() const
xmlt & new_element(const std::string &name)
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
const bv_typet & to_bv_type(const typet &type)
Cast a generic typet to a bv_typet.
const irep_idt & get_file() const
const fixedbv_typet & to_fixedbv_type(const typet &type)
Cast a generic typet to a fixedbv_typet.
Base class for all expressions.
const signedbv_typet & to_signedbv_type(const typet &type)
Cast a generic typet to a signedbv_typet.
const std::string & get_string(const irep_namet &name) const
const constant_exprt & to_constant_expr(const exprt &expr)
Cast a generic exprt to a constant_exprt.
const typet & subtype() const
std::string to_ansi_c_string() const
const vector_typet & to_vector_type(const typet &type)
Cast a generic typet to a vector_typet.
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a generic typet to a bitvector_typet.