30 if(type.
id()==ID_merged_type)
35 else if(type.
id()==ID_signed)
37 else if(type.
id()==ID_unsigned)
39 else if(type.
id()==ID_ptr32)
41 else if(type.
id()==ID_ptr64)
43 else if(type.
id()==ID_volatile)
45 else if(type.
id()==ID_asm)
51 else if(type.
id()==ID_section &&
57 else if(type.
id()==ID_const)
59 else if(type.
id()==ID_restrict)
61 else if(type.
id()==ID_atomic)
63 else if(type.
id()==ID_atomic_type_specifier)
69 else if(type.
id()==ID_char)
71 else if(type.
id()==ID_int)
73 else if(type.
id()==ID_int8)
75 else if(type.
id()==ID_int16)
77 else if(type.
id()==ID_int32)
79 else if(type.
id()==ID_int64)
81 else if(type.
id()==ID_gcc_float16)
83 else if(type.
id()==ID_gcc_float32)
85 else if(type.
id()==ID_gcc_float32x)
87 else if(type.
id()==ID_gcc_float64)
89 else if(type.
id()==ID_gcc_float64x)
91 else if(type.
id()==ID_gcc_float128)
93 else if(type.
id()==ID_gcc_float128x)
95 else if(type.
id()==ID_gcc_int128)
97 else if(type.
id()==ID_gcc_attribute_mode)
101 else if(type.
id()==ID_msc_based)
103 const exprt &as_expr=
104 static_cast<const exprt &
>(
static_cast<const irept &
>(type));
107 else if(type.
id()==ID_custom_bv)
110 const exprt &size_expr=
111 static_cast<const exprt &
>(type.
find(ID_size));
115 else if(type.
id()==ID_custom_floatbv)
119 const exprt &size_expr=
120 static_cast<const exprt &
>(type.
find(ID_size));
121 const exprt &fsize_expr=
122 static_cast<const exprt &
>(type.
find(ID_f));
127 else if(type.
id()==ID_custom_fixedbv)
131 const exprt &size_expr=
132 static_cast<const exprt &
>(type.
find(ID_size));
133 const exprt &fsize_expr=
134 static_cast<const exprt &
>(type.
find(ID_f));
139 else if(type.
id()==ID_short)
141 else if(type.
id()==ID_long)
143 else if(type.
id()==ID_double)
145 else if(type.
id()==ID_float)
147 else if(type.
id()==ID_c_bool)
149 else if(type.
id()==ID_proper_bool)
151 else if(type.
id()==ID_complex)
153 else if(type.
id()==ID_static)
155 else if(type.
id()==ID_thread_local)
157 else if(type.
id()==ID_inline)
159 else if(type.
id()==ID_extern)
161 else if(type.
id()==ID_typedef)
163 else if(type.
id()==ID_register)
165 else if(type.
id()==ID_weak)
167 else if(type.
id() == ID_used)
169 else if(type.
id()==ID_auto)
173 else if(type.
id()==ID_packed)
175 else if(type.
id()==ID_aligned)
185 else if(type.
id()==ID_transparent_union)
189 else if(type.
id()==ID_vector)
191 else if(type.
id()==ID_void)
196 other.push_back(tmp);
198 else if(type.
id()==ID_msc_declspec)
200 const exprt &as_expr=
201 static_cast<const exprt &
>(
static_cast<const irept &
>(type));
206 const irep_idt &
id=it->get(ID_identifier);
217 else if(type.
id()==ID_noreturn)
219 else if(type.
id()==ID_constructor)
221 else if(type.
id()==ID_destructor)
223 else if(type.
id()==ID_alias &&
229 else if(type.
id()==ID_frontend_pointer)
236 const irep_idt typedef_identifier=type.
get(ID_C_typedef);
237 if(!typedef_identifier.
empty())
238 tmp.
set(ID_C_typedef, typedef_identifier);
239 other.push_back(tmp);
241 else if(type.
id()==ID_pointer)
245 else if(type.
id() == ID_C_spec_requires)
247 const exprt &as_expr =
248 static_cast<const exprt &
>(
static_cast<const irept &
>(type));
251 else if(type.
id() == ID_C_spec_assigns)
253 const exprt &as_expr =
254 static_cast<const exprt &
>(
static_cast<const irept &
>(type));
259 operand.id() != ID_symbol && operand.id() != ID_ptrmember &&
260 operand.id() != ID_member && operand.id() != ID_dereference)
263 error() <<
"illegal target in assigns clause" <<
eom;
272 for(
auto &assignment :
to_unary_expr(as_expr).op().operands())
276 else if(type.
id() == ID_C_spec_ensures)
278 const exprt &as_expr =
279 static_cast<const exprt &
>(
static_cast<const irept &
>(type));
283 other.push_back(type);
305 error() <<
"illegal type modifier for defined type" <<
eom;
312 if(
other.front().id()==ID_asm &&
other.back().id()==ID_empty)
314 else if(
other.front().id()==ID_empty &&
other.back().id()==ID_asm)
321 error() <<
"illegal combination of defined types" <<
eom;
342 error() <<
"combining constructor and destructor not supported"
348 if(type.
id()==ID_code)
351 else if(type_p->
id()!=ID_empty)
354 error() <<
"constructor and destructor required to be type void, "
365 error() <<
"constructor and destructor required to be type void, "
380 error() <<
"cannot combine integer type with floating-point type" <<
eom;
391 error() <<
"conflicting type modifiers" <<
eom;
421 error() <<
"cannot combine integer type with floating-point type" <<
eom;
428 error() <<
"conflicting type modifiers" <<
eom;
446 error() <<
"conflicting type modifiers" <<
eom;
453 error() <<
"illegal type modifier for float" <<
eom;
465 error() <<
"illegal type modifier for C boolean type" <<
eom;
479 error() <<
"illegal type modifier for proper boolean type" <<
eom;
498 error() <<
"illegal type modifier for char type" <<
eom;
505 error() <<
"conflicting type modifiers" <<
eom;
524 error() <<
"conflicting type modifiers" <<
eom;
537 error() <<
"conflicting type modifiers" <<
eom;
574 type.
id(
is_signed?ID_custom_signedbv:ID_custom_unsignedbv);
579 type.
id(ID_custom_floatbv);
585 type.
id(ID_custom_fixedbv);
594 error() <<
"conflicting type modifiers" <<
eom;
627 error() <<
"illegal type modifier for integer type" <<
eom;
669 type.
set(ID_C_packed,
true);
ANSI-C Language Conversion.
floatbv_typet float_type()
signedbv_typet signed_long_int_type()
signedbv_typet signed_char_type()
unsignedbv_typet unsigned_int_type()
unsignedbv_typet unsigned_long_long_int_type()
unsignedbv_typet unsigned_long_int_type()
signedbv_typet signed_int_type()
unsignedbv_typet unsigned_char_type()
bitvector_typet char_type()
signedbv_typet signed_long_long_int_type()
floatbv_typet long_double_type()
floatbv_typet double_type()
signedbv_typet signed_short_int_type()
unsignedbv_typet unsigned_short_int_type()
const code_with_contract_typet & to_code_with_contract_type(const typet &type)
Cast a typet to a code_with_contract_typet.
virtual void read_rec(const typet &type)
c_storage_spect c_storage_spec
virtual void read(const typet &type)
virtual void write(typet &type)
unsigned gcc_float128x_cnt
unsigned gcc_float32x_cnt
exprt::operandst requires
virtual void set_attributes(typet &type) const
Add qualifiers and GCC attributes onto type.
unsigned gcc_float64x_cnt
source_locationt source_location
virtual void build_type_with_subtype(typet &type) const
Build a vector or complex type with type as subtype.
c_qualifierst c_qualifiers
unsigned gcc_float128_cnt
virtual void write(typet &src) const override
bool is_transparent_union
const typet & return_type() const
const exprt::operandst & requires() const
const exprt & assigns() const
const exprt::operandst & ensures() const
Complex numbers made of pair of given subtype.
struct configt::ansi_ct ansi_c
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
const source_locationt & source_location() const
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
void set(const irep_namet &name, const irep_idt &value)
const irept & find(const irep_namet &name) const
const irep_idt & id() const
const irep_idt & get(const irep_namet &name) const
source_locationt source_location
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
const irep_idt & get_value() const
Type with a single subtype.
The type of an expression, extends irept.
const source_locationt & source_location() const
const typet & subtype() const
source_locationt & add_source_location()
const constant_exprt & size() const
#define forall_operands(it, expr)
floatbv_typet gcc_float32_type()
floatbv_typet gcc_float16_type()
floatbv_typet gcc_float64_type()
signedbv_typet gcc_signed_int128_type()
floatbv_typet gcc_float32x_type()
floatbv_typet gcc_float64x_type()
floatbv_typet gcc_float128x_type()
unsignedbv_typet gcc_unsigned_int128_type()
floatbv_typet gcc_float128_type()
#define UNREACHABLE
This should be used to mark dead code.
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 string_constantt & to_string_constant(const exprt &expr)
std::size_t pointer_width
const type_with_subtypest & to_type_with_subtypes(const typet &type)
bool is_signed(const typet &t)
Convenience function – is the type signed?