29 result.
name=
"location";
54 if(type.
id()==ID_symbol)
59 if(type.
id()==ID_unsignedbv)
61 result.
name=
"integer";
64 else if(type.
id()==ID_signedbv)
66 result.
name=
"integer";
69 else if(type.
id()==ID_floatbv)
74 else if(type.
id()==ID_bv)
76 result.
name=
"integer";
79 else if(type.
id()==ID_c_bit_field)
81 result.
name=
"integer";
84 else if(type.
id()==ID_c_enum_tag)
89 else if(type.
id()==ID_fixedbv)
94 else if(type.
id()==ID_pointer)
96 result.
name=
"pointer";
99 else if(type.
id()==ID_bool)
101 result.
name=
"boolean";
103 else if(type.
id()==ID_array)
108 else if(type.
id()==ID_vector)
110 result.
name=
"vector";
115 else if(type.
id()==ID_struct)
117 result.
name=
"struct";
120 for(
const auto &component : components)
127 else if(type.
id()==ID_union)
132 for(
const auto &component : components)
140 result.
name=
"unknown";
153 if(expr.
id()==ID_constant)
155 if(type.
id()==ID_unsignedbv ||
156 type.
id()==ID_signedbv ||
157 type.
id()==ID_c_bit_field)
161 result.
name=
"integer";
166 const typet &underlying_type=
167 type.
id()==ID_c_bit_field?type.
subtype():
172 std::string sig=
is_signed?
"":
"unsigned ";
189 else if(type.
id()==ID_c_enum)
191 result.
name=
"integer";
200 else if(type.
id()==ID_c_enum_tag)
207 else if(type.
id()==ID_bv)
209 result.
name=
"bitvector";
212 else if(type.
id()==ID_fixedbv)
219 else if(type.
id()==ID_floatbv)
226 else if(type.
id()==ID_pointer)
228 result.
name=
"pointer";
230 if(expr.
get(ID_value)==ID_NULL)
233 else if(type.
id()==ID_bool)
235 result.
name=
"boolean";
239 else if(type.
id()==ID_c_bool)
241 result.
name=
"integer";
250 result.
name=
"unknown";
253 else if(expr.
id()==ID_array)
267 else if(expr.
id()==ID_struct)
269 result.
name=
"struct";
272 if(type.
id()==ID_struct)
276 assert(components.size()==expr.
operands().size());
278 for(
unsigned m=0; m<expr.
operands().size(); m++)
286 else if(expr.
id()==ID_union)
299 result.
name=
"unknown";
The type of an expression.
bool is_signed(const typet &t)
Convenience function – is the type signed?
const irep_idt & get_working_directory() 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 signedbv_typet & to_signedbv_type(const typet &type)
Cast a generic typet to a signedbv_typet.
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a generic typet to a bitvector_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 typet & follow_tag(const union_tag_typet &) const
const irep_idt & get_column() const
const irep_idt & id() const
void set_value(const irep_idt &value)
std::size_t long_long_int_width
const irep_idt & get_line() const
API to expression classes.
void set_attribute(const std::string &attribute, unsigned value)
const irep_idt & get(const irep_namet &name) const
const vector_typet & to_vector_type(const typet &type)
Cast a generic typet to a vector_typet.
#define forall_operands(it, expr)
const typet & follow(const typet &) const
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast a generic exprt to a constant_exprt.
const bv_typet & to_bv_type(const typet &type)
Cast a generic typet to a bv_typet.
std::size_t get_width() const
xmlt & new_element(const std::string &name)
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a generic typet to a c_enum_tag_typet.
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a generic typet to an unsignedbv_typet.
const irep_idt & get_file() const
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a generic typet to a floatbv_typet.
const fixedbv_typet & to_fixedbv_type(const typet &type)
Cast a generic typet to a fixedbv_typet.
Base class for all expressions.
const union_exprt & to_union_expr(const exprt &expr)
Cast a generic exprt to a union_exprt.
const union_typet & to_union_type(const typet &type)
Cast a generic typet to a union_typet.
const std::string & get_string(const irep_namet &name) const
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a generic typet to a c_bit_field_typet.
const typet & subtype() const
std::string to_ansi_c_string() const
std::size_t long_int_width
std::size_t short_int_width