CBMC
ansi_c_convert_type.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: SpecC Language Conversion
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #include "ansi_c_convert_type.h"
13 
14 #include <util/c_types.h>
15 #include <util/config.h>
16 #include <util/std_code.h>
17 #include <util/std_types.h>
18 #include <util/string_constant.h>
19 
20 #include "gcc_types.h"
21 
23 {
24  clear();
26  read_rec(type);
27 }
28 
30 {
31  if(type.id()==ID_merged_type)
32  {
33  for(const typet &subtype : to_type_with_subtypes(type).subtypes())
34  read_rec(subtype);
35  }
36  else if(type.id()==ID_signed)
37  signed_cnt++;
38  else if(type.id()==ID_unsigned)
39  unsigned_cnt++;
40  else if(type.id()==ID_ptr32)
42  else if(type.id()==ID_ptr64)
44  else if(type.id()==ID_volatile)
46  else if(type.id()==ID_asm)
47  {
48  // These can have up to 5 subtypes; we only use the first one.
49  const auto &type_with_subtypes = to_type_with_subtypes(type);
50  if(
51  !type_with_subtypes.subtypes().empty() &&
52  type_with_subtypes.subtypes()[0].id() == ID_string_constant)
54  to_string_constant(type_with_subtypes.subtypes()[0]).get_value();
55  }
56  else if(
57  type.id() == ID_section && type.has_subtype() &&
58  to_type_with_subtype(type).subtype().id() == ID_string_constant)
59  {
62  }
63  else if(type.id()==ID_const)
65  else if(type.id()==ID_restrict)
67  else if(type.id()==ID_atomic)
69  else if(type.id()==ID_atomic_type_specifier)
70  {
71  // this gets turned into the qualifier, uh
73  read_rec(to_type_with_subtype(type).subtype());
74  }
75  else if(type.id()==ID_char)
76  char_cnt++;
77  else if(type.id()==ID_int)
78  int_cnt++;
79  else if(type.id()==ID_int8)
80  int8_cnt++;
81  else if(type.id()==ID_int16)
82  int16_cnt++;
83  else if(type.id()==ID_int32)
84  int32_cnt++;
85  else if(type.id()==ID_int64)
86  int64_cnt++;
87  else if(type.id()==ID_gcc_float16)
89  else if(type.id()==ID_gcc_float32)
91  else if(type.id()==ID_gcc_float32x)
93  else if(type.id()==ID_gcc_float64)
95  else if(type.id()==ID_gcc_float64x)
97  else if(type.id()==ID_gcc_float128)
99  else if(type.id()==ID_gcc_float128x)
101  else if(type.id()==ID_gcc_int128)
102  gcc_int128_cnt++;
103  else if(type.id()==ID_gcc_attribute_mode)
104  {
105  gcc_attribute_mode=type;
106  }
107  else if(type.id()==ID_msc_based)
108  {
109  const exprt &as_expr=
110  static_cast<const exprt &>(static_cast<const irept &>(type));
111  msc_based = to_unary_expr(as_expr).op();
112  }
113  else if(type.id()==ID_custom_bv)
114  {
115  bv_cnt++;
116  const exprt &size_expr=
117  static_cast<const exprt &>(type.find(ID_size));
118 
119  bv_width=size_expr;
120  }
121  else if(type.id()==ID_custom_floatbv)
122  {
123  floatbv_cnt++;
124 
125  const exprt &size_expr=
126  static_cast<const exprt &>(type.find(ID_size));
127  const exprt &fsize_expr=
128  static_cast<const exprt &>(type.find(ID_f));
129 
130  bv_width=size_expr;
131  fraction_width=fsize_expr;
132  }
133  else if(type.id()==ID_custom_fixedbv)
134  {
135  fixedbv_cnt++;
136 
137  const exprt &size_expr=
138  static_cast<const exprt &>(type.find(ID_size));
139  const exprt &fsize_expr=
140  static_cast<const exprt &>(type.find(ID_f));
141 
142  bv_width=size_expr;
143  fraction_width=fsize_expr;
144  }
145  else if(type.id()==ID_short)
146  short_cnt++;
147  else if(type.id()==ID_long)
148  long_cnt++;
149  else if(type.id()==ID_double)
150  double_cnt++;
151  else if(type.id()==ID_float)
152  float_cnt++;
153  else if(type.id()==ID_c_bool)
154  c_bool_cnt++;
155  else if(type.id()==ID_proper_bool)
156  proper_bool_cnt++;
157  else if(type.id()==ID_complex)
158  complex_cnt++;
159  else if(type.id()==ID_static)
161  else if(type.id()==ID_thread_local)
163  else if(type.id()==ID_inline)
165  else if(type.id()==ID_extern)
167  else if(type.id()==ID_typedef)
169  else if(type.id()==ID_register)
171  else if(type.id()==ID_weak)
172  c_storage_spec.is_weak=true;
173  else if(type.id() == ID_used)
174  c_storage_spec.is_used = true;
175  else if(type.id()==ID_auto)
176  {
177  // ignore
178  }
179  else if(type.id()==ID_packed)
180  packed=true;
181  else if(type.id()==ID_aligned)
182  {
183  aligned=true;
184 
185  // may come with size or not
186  if(type.find(ID_size).is_nil())
187  alignment=exprt(ID_default);
188  else
189  alignment=static_cast<const exprt &>(type.find(ID_size));
190  }
191  else if(type.id()==ID_transparent_union)
192  {
194  }
195  else if(type.id() == ID_frontend_vector)
196  {
197  // note that this is not yet a vector_typet -- this is a size only
198  vector_size = static_cast<const constant_exprt &>(type.find(ID_size));
199  }
200  else if(type.id()==ID_void)
201  {
202  // we store 'void' as 'empty'
203  typet tmp=type;
204  tmp.id(ID_empty);
205  other.push_back(tmp);
206  }
207  else if(type.id()==ID_msc_declspec)
208  {
209  const exprt &as_expr=
210  static_cast<const exprt &>(static_cast<const irept &>(type));
211 
212  forall_operands(it, as_expr)
213  {
214  // these are symbols
215  const irep_idt &id=it->get(ID_identifier);
216 
217  if(id==ID_thread)
219  else if(id=="align")
220  {
221  aligned=true;
222  alignment = to_unary_expr(*it).op();
223  }
224  }
225  }
226  else if(type.id()==ID_noreturn)
228  else if(type.id()==ID_constructor)
229  constructor=true;
230  else if(type.id()==ID_destructor)
231  destructor=true;
232  else if(
233  type.id() == ID_alias && type.has_subtype() &&
234  to_type_with_subtype(type).subtype().id() == ID_string_constant)
235  {
238  }
239  else if(type.id()==ID_frontend_pointer)
240  {
241  // We turn ID_frontend_pointer to ID_pointer
242  // Pointers have a width, much like integers,
243  // which is added here.
244  pointer_typet tmp(
247  const irep_idt typedef_identifier=type.get(ID_C_typedef);
248  if(!typedef_identifier.empty())
249  tmp.set(ID_C_typedef, typedef_identifier);
250  other.push_back(tmp);
251  }
252  else if(type.id()==ID_pointer)
253  {
254  UNREACHABLE;
255  }
256  else if(type.id() == ID_C_spec_requires)
257  {
258  const exprt &as_expr =
259  static_cast<const exprt &>(static_cast<const irept &>(type));
260  requires.push_back(to_unary_expr(as_expr).op());
261  }
262  else if(type.id() == ID_C_spec_requires_contract)
263  {
264  const exprt &as_expr =
265  static_cast<const exprt &>(static_cast<const irept &>(type));
266  requires_contract.push_back(to_unary_expr(as_expr).op());
267  }
268  else if(type.id() == ID_C_spec_assigns)
269  {
270  const exprt &as_expr =
271  static_cast<const exprt &>(static_cast<const irept &>(type));
272 
273  for(const exprt &target : to_unary_expr(as_expr).op().operands())
274  assigns.push_back(target);
275  }
276  else if(type.id() == ID_C_spec_ensures)
277  {
278  const exprt &as_expr =
279  static_cast<const exprt &>(static_cast<const irept &>(type));
280  ensures.push_back(to_unary_expr(as_expr).op());
281  }
282  else if(type.id() == ID_C_spec_ensures_contract)
283  {
284  const exprt &as_expr =
285  static_cast<const exprt &>(static_cast<const irept &>(type));
286  ensures_contract.push_back(to_unary_expr(as_expr).op());
287  }
288  else
289  other.push_back(type);
290 }
291 
293 {
294  type.clear();
295 
296  // first, do "other"
297 
298  if(!other.empty())
299  {
300  if(double_cnt || float_cnt || signed_cnt ||
304  gcc_float16_cnt ||
309  {
311  error() << "illegal type modifier for defined type" << eom;
312  throw 0;
313  }
314 
315  // asm blocks (cf. regression/ansi-c/asm1) - ignore the asm
316  if(other.size()==2)
317  {
318  if(other.front().id()==ID_asm && other.back().id()==ID_empty)
319  other.pop_front();
320  else if(other.front().id()==ID_empty && other.back().id()==ID_asm)
321  other.pop_back();
322  }
323 
324  if(other.size()!=1)
325  {
327  error() << "illegal combination of defined types" << eom;
328  throw 0;
329  }
330 
331  type.swap(other.front());
332 
333  // the contract expressions are meant for function types only
334  if(!requires.empty())
335  to_code_with_contract_type(type).requires() = std::move(requires);
336 
337  if(!requires_contract.empty())
339  std::move(requires_contract);
340 
341  if(!assigns.empty())
342  to_code_with_contract_type(type).assigns() = std::move(assigns);
343 
344  if(!ensures.empty())
345  to_code_with_contract_type(type).ensures() = std::move(ensures);
346 
347  if(!ensures_contract.empty())
349  std::move(ensures_contract);
350 
351  if(constructor || destructor)
352  {
353  if(constructor && destructor)
354  {
356  error() << "combining constructor and destructor not supported"
357  << eom;
358  throw 0;
359  }
360 
361  typet *type_p=&type;
362  if(type.id()==ID_code)
363  type_p=&(to_code_type(type).return_type());
364 
365  else if(type_p->id()!=ID_empty)
366  {
368  error() << "constructor and destructor required to be type void, "
369  << "found " << type_p->pretty() << eom;
370  throw 0;
371  }
372 
373  type_p->id(constructor ? ID_constructor : ID_destructor);
374  }
375  }
376  else if(constructor || destructor)
377  {
379  error() << "constructor and destructor required to be type void, "
380  << "found " << type.pretty() << eom;
381  throw 0;
382  }
383  else if(gcc_float16_cnt ||
387  {
390  gcc_int128_cnt || bv_cnt ||
391  short_cnt || char_cnt)
392  {
394  error() << "cannot combine integer type with floating-point type" << eom;
395  throw 0;
396  }
397 
398  if(long_cnt+double_cnt+
403  {
405  error() << "conflicting type modifiers" << eom;
406  throw 0;
407  }
408 
409  // _not_ the same as float, double, long double
410  if(gcc_float16_cnt)
411  type=gcc_float16_type();
412  else if(gcc_float32_cnt)
413  type=gcc_float32_type();
414  else if(gcc_float32x_cnt)
415  type=gcc_float32x_type();
416  else if(gcc_float64_cnt)
417  type=gcc_float64_type();
418  else if(gcc_float64x_cnt)
419  type=gcc_float64x_type();
420  else if(gcc_float128_cnt)
421  type=gcc_float128_type();
422  else if(gcc_float128x_cnt)
423  type=gcc_float128x_type();
424  else
425  UNREACHABLE;
426  }
427  else if(double_cnt || float_cnt)
428  {
432  short_cnt || char_cnt)
433  {
435  error() << "cannot combine integer type with floating-point type" << eom;
436  throw 0;
437  }
438 
439  if(double_cnt && float_cnt)
440  {
442  error() << "conflicting type modifiers" << eom;
443  throw 0;
444  }
445 
446  if(long_cnt==0)
447  {
448  if(double_cnt!=0)
449  type=double_type();
450  else
451  type=float_type();
452  }
453  else if(long_cnt==1 || long_cnt==2)
454  {
455  if(double_cnt!=0)
456  type=long_double_type();
457  else
458  {
460  error() << "conflicting type modifiers" << eom;
461  throw 0;
462  }
463  }
464  else
465  {
467  error() << "illegal type modifier for float" << eom;
468  throw 0;
469  }
470  }
471  else if(c_bool_cnt)
472  {
476  char_cnt || long_cnt)
477  {
479  error() << "illegal type modifier for C boolean type" << eom;
480  throw 0;
481  }
482 
483  type=c_bool_type();
484  }
485  else if(proper_bool_cnt)
486  {
490  char_cnt || long_cnt)
491  {
493  error() << "illegal type modifier for proper boolean type" << eom;
494  throw 0;
495  }
496 
497  type.id(ID_bool);
498  }
499  else if(complex_cnt && !char_cnt && !signed_cnt && !unsigned_cnt &&
501  {
502  // the "default" for complex is double
503  type=double_type();
504  }
505  else if(char_cnt)
506  {
507  if(int_cnt || short_cnt || long_cnt ||
510  {
512  error() << "illegal type modifier for char type" << eom;
513  throw 0;
514  }
515 
516  if(signed_cnt && unsigned_cnt)
517  {
519  error() << "conflicting type modifiers" << eom;
520  throw 0;
521  }
522  else if(unsigned_cnt)
523  type=unsigned_char_type();
524  else if(signed_cnt)
525  type=signed_char_type();
526  else
527  type=char_type();
528  }
529  else
530  {
531  // it is integer -- signed or unsigned?
532 
533  bool is_signed=true; // default
534 
535  if(signed_cnt && unsigned_cnt)
536  {
538  error() << "conflicting type modifiers" << eom;
539  throw 0;
540  }
541  else if(unsigned_cnt)
542  is_signed=false;
543  else if(signed_cnt)
544  is_signed=true;
545 
547  {
549  {
551  error() << "conflicting type modifiers" << eom;
552  throw 0;
553  }
554 
555  if(int8_cnt)
556  if(is_signed)
557  type=signed_char_type();
558  else
559  type=unsigned_char_type();
560  else if(int16_cnt)
561  if(is_signed)
562  type=signed_short_int_type();
563  else
565  else if(int32_cnt)
566  if(is_signed)
567  type=signed_int_type();
568  else
569  type=unsigned_int_type();
570  else if(int64_cnt) // Visual Studio: equivalent to long long int
571  if(is_signed)
573  else
575  else
576  UNREACHABLE;
577  }
578  else if(gcc_int128_cnt)
579  {
580  if(is_signed)
581  type=gcc_signed_int128_type();
582  else
584  }
585  else if(bv_cnt)
586  {
587  // explicitly-given expression for width
588  type.id(is_signed?ID_custom_signedbv:ID_custom_unsignedbv);
589  type.set(ID_size, bv_width);
590  }
591  else if(floatbv_cnt)
592  {
593  type.id(ID_custom_floatbv);
594  type.set(ID_size, bv_width);
595  type.set(ID_f, fraction_width);
596  }
597  else if(fixedbv_cnt)
598  {
599  type.id(ID_custom_fixedbv);
600  type.set(ID_size, bv_width);
601  type.set(ID_f, fraction_width);
602  }
603  else if(short_cnt)
604  {
605  if(long_cnt || char_cnt)
606  {
608  error() << "conflicting type modifiers" << eom;
609  throw 0;
610  }
611 
612  if(is_signed)
613  type=signed_short_int_type();
614  else
616  }
617  else if(long_cnt==0)
618  {
619  if(is_signed)
620  type=signed_int_type();
621  else
622  type=unsigned_int_type();
623  }
624  else if(long_cnt==1)
625  {
626  if(is_signed)
627  type=signed_long_int_type();
628  else
629  type=unsigned_long_int_type();
630  }
631  else if(long_cnt==2)
632  {
633  if(is_signed)
635  else
637  }
638  else
639  {
641  error() << "illegal type modifier for integer type" << eom;
642  throw 0;
643  }
644  }
645 
647  set_attributes(type);
648 }
649 
652 {
653  if(vector_size.is_not_nil())
654  {
655  type_with_subtypet new_type(ID_frontend_vector, type);
656  new_type.set(ID_size, vector_size);
658  type=new_type;
659  }
660 
661  if(complex_cnt)
662  {
663  // These take more or less arbitrary subtypes.
664  complex_typet new_type(type);
666  type.swap(new_type);
667  }
668 }
669 
672 {
674  {
675  typet new_type=gcc_attribute_mode;
676  new_type.add_subtype() = type;
677  type.swap(new_type);
678  }
679 
680  c_qualifiers.write(type);
681 
682  if(packed)
683  type.set(ID_C_packed, true);
684 
685  if(aligned)
686  type.set(ID_C_alignment, alignment);
687 }
UNREACHABLE
#define UNREACHABLE
This should be used to mark dead code.
Definition: invariant.h:503
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
to_code_with_contract_type
const code_with_contract_typet & to_code_with_contract_type(const typet &type)
Cast a typet to a code_with_contract_typet.
Definition: c_types.h:447
to_unary_expr
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
Definition: std_expr.h:361
ansi_c_convert_typet::int8_cnt
unsigned int8_cnt
Definition: ansi_c_convert_type.h:32
gcc_float32_type
floatbv_typet gcc_float32_type()
Definition: gcc_types.cpp:21
ansi_c_convert_typet::gcc_attribute_mode
typet gcc_attribute_mode
Definition: ansi_c_convert_type.h:42
irept::clear
void clear()
Definition: irep.h:452
ansi_c_convert_typet::clear
virtual void clear()
Definition: ansi_c_convert_type.h:72
ansi_c_convert_typet::set_attributes
virtual void set_attributes(typet &type) const
Add qualifiers and GCC attributes onto type.
Definition: ansi_c_convert_type.cpp:671
ansi_c_convert_typet::msc_based
exprt msc_based
Definition: ansi_c_convert_type.h:46
gcc_float64x_type
floatbv_typet gcc_float64x_type()
Definition: gcc_types.cpp:48
signed_long_long_int_type
signedbv_typet signed_long_long_int_type()
Definition: c_types.cpp:97
signed_char_type
signedbv_typet signed_char_type()
Definition: c_types.cpp:152
typet
The type of an expression, extends irept.
Definition: type.h:28
gcc_float16_type
floatbv_typet gcc_float16_type()
Definition: gcc_types.cpp:13
irept::pretty
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:495
ansi_c_convert_type.h
gcc_types.h
irept::find
const irept & find(const irep_idt &name) const
Definition: irep.cpp:106
typet::has_subtype
bool has_subtype() const
Definition: type.h:82
long_double_type
floatbv_typet long_double_type()
Definition: c_types.cpp:211
c_qualifierst::is_ptr64
bool is_ptr64
Definition: c_qualifiers.h:95
ansi_c_convert_typet::gcc_float32x_cnt
unsigned gcc_float32x_cnt
Definition: ansi_c_convert_type.h:35
ansi_c_convert_typet::write
virtual void write(typet &type)
Definition: ansi_c_convert_type.cpp:292
ansi_c_convert_typet::source_location
source_locationt source_location
Definition: ansi_c_convert_type.h:62
is_signed
bool is_signed(const typet &t)
Convenience function – is the type signed?
Definition: util.cpp:45
ansi_c_convert_typet::vector_size
exprt vector_size
Definition: ansi_c_convert_type.h:45
ansi_c_convert_typet::c_qualifiers
c_qualifierst c_qualifiers
Definition: ansi_c_convert_type.h:57
c_bool_type
typet c_bool_type()
Definition: c_types.cpp:118
c_qualifierst::is_volatile
bool is_volatile
Definition: c_qualifiers.h:92
c_storage_spect::section
irep_idt section
Definition: c_storage_spec.h:54
ansi_c_convert_typet::int_cnt
unsigned int_cnt
Definition: ansi_c_convert_type.h:27
c_storage_spect::is_extern
bool is_extern
Definition: c_storage_spec.h:46
to_string_constant
const string_constantt & to_string_constant(const exprt &expr)
Definition: string_constant.h:40
to_type_with_subtype
const type_with_subtypet & to_type_with_subtype(const typet &type)
Definition: type.h:193
to_type_with_subtypes
const type_with_subtypest & to_type_with_subtypes(const typet &type)
Definition: type.h:237
string_constant.h
exprt
Base class for all expressions.
Definition: expr.h:55
complex_typet
Complex numbers made of pair of given subtype.
Definition: std_types.h:1076
ansi_c_convert_typet::signed_cnt
unsigned signed_cnt
Definition: ansi_c_convert_type.h:26
messaget::eom
static eomt eom
Definition: message.h:297
ansi_c_convert_typet::ensures_contract
exprt::operandst ensures_contract
Definition: ansi_c_convert_type.h:50
unsigned_char_type
unsignedbv_typet unsigned_char_type()
Definition: c_types.cpp:145
type_with_subtypet
Type with a single subtype.
Definition: type.h:164
ansi_c_convert_typet::gcc_float64x_cnt
unsigned gcc_float64x_cnt
Definition: ansi_c_convert_type.h:36
code_with_contract_typet::ensures_contract
const exprt::operandst & ensures_contract() const
Definition: c_types.h:407
c_storage_spect::is_register
bool is_register
Definition: c_storage_spec.h:46
configt::ansi_c
struct configt::ansi_ct ansi_c
code_with_contract_typet::assigns
const exprt::operandst & assigns() const
Definition: c_types.h:376
gcc_float128_type
floatbv_typet gcc_float128_type()
Definition: gcc_types.cpp:57
unsigned_short_int_type
unsignedbv_typet unsigned_short_int_type()
Definition: c_types.cpp:61
ansi_c_convert_typet::double_cnt
unsigned double_cnt
Definition: ansi_c_convert_type.h:28
irept::get
const irep_idt & get(const irep_idt &name) const
Definition: irep.cpp:45
gcc_float64_type
floatbv_typet gcc_float64_type()
Definition: gcc_types.cpp:39
unsigned_long_long_int_type
unsignedbv_typet unsigned_long_long_int_type()
Definition: c_types.cpp:111
ansi_c_convert_typet::fixedbv_cnt
unsigned fixedbv_cnt
Definition: ansi_c_convert_type.h:40
unsigned_long_int_type
unsignedbv_typet unsigned_long_int_type()
Definition: c_types.cpp:104
irept::is_not_nil
bool is_not_nil() const
Definition: irep.h:380
ansi_c_convert_typet::int64_cnt
unsigned int64_cnt
Definition: ansi_c_convert_type.h:32
ansi_c_convert_typet::gcc_float64_cnt
unsigned gcc_float64_cnt
Definition: ansi_c_convert_type.h:36
ansi_c_convert_typet::requires
exprt::operandst requires
Definition: ansi_c_convert_type.h:50
to_code_type
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
Definition: std_types.h:744
c_storage_spect::is_inline
bool is_inline
Definition: c_storage_spec.h:47
messaget::error
mstreamt & error() const
Definition: message.h:399
signed_int_type
signedbv_typet signed_int_type()
Definition: c_types.cpp:40
c_qualifierst::is_constant
bool is_constant
Definition: c_qualifiers.h:92
ansi_c_convert_typet::c_bool_cnt
unsigned c_bool_cnt
Definition: ansi_c_convert_type.h:28
ansi_c_convert_typet::gcc_float32_cnt
unsigned gcc_float32_cnt
Definition: ansi_c_convert_type.h:35
ansi_c_convert_typet::gcc_int128_cnt
unsigned gcc_int128_cnt
Definition: ansi_c_convert_type.h:38
messaget::mstreamt::source_location
source_locationt source_location
Definition: message.h:247
ansi_c_convert_typet::int32_cnt
unsigned int32_cnt
Definition: ansi_c_convert_type.h:32
forall_operands
#define forall_operands(it, expr)
Definition: expr.h:20
gcc_signed_int128_type
signedbv_typet gcc_signed_int128_type()
Definition: gcc_types.cpp:82
irept::set
void set(const irep_idt &name, const irep_idt &value)
Definition: irep.h:420
ansi_c_convert_typet::bv_cnt
unsigned bv_cnt
Definition: ansi_c_convert_type.h:39
ansi_c_convert_typet::requires_contract
exprt::operandst requires_contract
Definition: ansi_c_convert_type.h:51
typet::source_location
const source_locationt & source_location() const
Definition: type.h:90
ansi_c_convert_typet::char_cnt
unsigned char_cnt
Definition: ansi_c_convert_type.h:26
ansi_c_convert_typet::complex_cnt
unsigned complex_cnt
Definition: ansi_c_convert_type.h:29
ansi_c_convert_typet::proper_bool_cnt
unsigned proper_bool_cnt
Definition: ansi_c_convert_type.h:29
std_types.h
signed_short_int_type
signedbv_typet signed_short_int_type()
Definition: c_types.cpp:47
c_qualifierst::write
virtual void write(typet &src) const override
Definition: c_qualifiers.cpp:89
float_type
floatbv_typet float_type()
Definition: c_types.cpp:195
ansi_c_convert_typet::gcc_float128_cnt
unsigned gcc_float128_cnt
Definition: ansi_c_convert_type.h:37
ansi_c_convert_typet::short_cnt
unsigned short_cnt
Definition: ansi_c_convert_type.h:27
ansi_c_convert_typet::constructor
bool constructor
Definition: ansi_c_convert_type.h:47
ansi_c_convert_typet::gcc_float16_cnt
unsigned gcc_float16_cnt
Definition: ansi_c_convert_type.h:34
c_storage_spect::asm_label
irep_idt asm_label
Definition: c_storage_spec.h:53
ansi_c_convert_typet::aligned
bool aligned
Definition: ansi_c_convert_type.h:44
unsigned_int_type
unsignedbv_typet unsigned_int_type()
Definition: c_types.cpp:54
irept::swap
void swap(irept &irep)
Definition: irep.h:442
irept::is_nil
bool is_nil() const
Definition: irep.h:376
irept::id
const irep_idt & id() const
Definition: irep.h:396
c_storage_spect::alias
irep_idt alias
Definition: c_storage_spec.h:50
dstringt::empty
bool empty() const
Definition: dstring.h:88
unary_exprt::op
const exprt & op() const
Definition: std_expr.h:326
c_storage_spect::is_used
bool is_used
Definition: c_storage_spec.h:47
ansi_c_convert_typet::other
std::list< typet > other
Definition: ansi_c_convert_type.h:64
typet::add_source_location
source_locationt & add_source_location()
Definition: type.h:95
ansi_c_convert_typet::assigns
exprt::operandst assigns
Definition: ansi_c_convert_type.h:50
std_code.h
ansi_c_convert_typet::bv_width
exprt bv_width
Definition: ansi_c_convert_type.h:45
ansi_c_convert_typet::c_storage_spec
c_storage_spect c_storage_spec
Definition: ansi_c_convert_type.h:54
code_with_contract_typet::requires_contract
const exprt::operandst & requires_contract() const
Definition: c_types.h:386
typet::add_subtype
typet & add_subtype()
Definition: type.h:71
ansi_c_convert_typet::ensures
exprt::operandst ensures
Definition: ansi_c_convert_type.h:50
double_type
floatbv_typet double_type()
Definition: c_types.cpp:203
config
configt config
Definition: config.cpp:25
ansi_c_convert_typet::long_cnt
unsigned long_cnt
Definition: ansi_c_convert_type.h:27
char_type
bitvector_typet char_type()
Definition: c_types.cpp:124
ansi_c_convert_typet::destructor
bool destructor
Definition: ansi_c_convert_type.h:47
ansi_c_convert_typet::floatbv_cnt
unsigned floatbv_cnt
Definition: ansi_c_convert_type.h:40
ansi_c_convert_typet::build_type_with_subtype
virtual void build_type_with_subtype(typet &type) const
Build a vector or complex type with type as subtype.
Definition: ansi_c_convert_type.cpp:651
ansi_c_convert_typet::unsigned_cnt
unsigned unsigned_cnt
Definition: ansi_c_convert_type.h:26
ansi_c_convert_typet::int16_cnt
unsigned int16_cnt
Definition: ansi_c_convert_type.h:32
ansi_c_convert_typet::alignment
exprt alignment
Definition: ansi_c_convert_type.h:45
c_qualifierst::is_atomic
bool is_atomic
Definition: c_qualifiers.h:92
c_qualifierst::is_restricted
bool is_restricted
Definition: c_qualifiers.h:92
code_with_contract_typet::ensures
const exprt::operandst & ensures() const
Definition: c_types.h:418
gcc_unsigned_int128_type
unsignedbv_typet gcc_unsigned_int128_type()
Definition: gcc_types.cpp:75
c_storage_spect::is_weak
bool is_weak
Definition: c_storage_spec.h:47
config.h
signed_long_int_type
signedbv_typet signed_long_int_type()
Definition: c_types.cpp:90
ansi_c_convert_typet::packed
bool packed
Definition: ansi_c_convert_type.h:44
code_typet::return_type
const typet & return_type() const
Definition: std_types.h:645
ansi_c_convert_typet::gcc_float128x_cnt
unsigned gcc_float128x_cnt
Definition: ansi_c_convert_type.h:37
ansi_c_convert_typet::read
virtual void read(const typet &type)
Definition: ansi_c_convert_type.cpp:22
irept
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:359
c_storage_spect::is_thread_local
bool is_thread_local
Definition: c_storage_spec.h:47
c_storage_spect::is_static
bool is_static
Definition: c_storage_spec.h:46
exprt::operands
operandst & operands()
Definition: expr.h:94
configt::ansi_ct::pointer_width
std::size_t pointer_width
Definition: config.h:130
c_qualifierst::is_ptr32
bool is_ptr32
Definition: c_qualifiers.h:95
pointer_typet
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
Definition: pointer_expr.h:23
constant_exprt
A constant literal expression.
Definition: std_expr.h:2941
c_storage_spect::is_typedef
bool is_typedef
Definition: c_storage_spec.h:46
ansi_c_convert_typet::float_cnt
unsigned float_cnt
Definition: ansi_c_convert_type.h:28
c_qualifierst::is_noreturn
bool is_noreturn
Definition: c_qualifiers.h:92
exprt::source_location
const source_locationt & source_location() const
Definition: expr.h:211
c_types.h
gcc_float32x_type
floatbv_typet gcc_float32x_type()
Definition: gcc_types.cpp:30
code_with_contract_typet::requires
const exprt::operandst & requires() const
Definition: c_types.h:397
string_constantt::get_value
const irep_idt & get_value() const
Definition: string_constant.h:21
ansi_c_convert_typet::fraction_width
exprt fraction_width
Definition: ansi_c_convert_type.h:45
ansi_c_convert_typet::read_rec
virtual void read_rec(const typet &type)
Definition: ansi_c_convert_type.cpp:29
c_qualifierst::is_transparent_union
bool is_transparent_union
Definition: c_qualifiers.h:98
gcc_float128x_type
floatbv_typet gcc_float128x_type()
Definition: gcc_types.cpp:66