@@ -23,7 +23,7 @@ Function: index_type
23
23
24
24
\*******************************************************************/
25
25
26
- typet index_type ()
26
+ bitvector_typet index_type ()
27
27
{
28
28
// same as signed size type
29
29
return signed_size_type ();
@@ -41,7 +41,7 @@ Function: enum_constant_type
41
41
42
42
\*******************************************************************/
43
43
44
- typet enum_constant_type ()
44
+ bitvector_typet enum_constant_type ()
45
45
{
46
46
// usually same as 'int',
47
47
// but might be unsigned, or shorter than 'int'
@@ -60,9 +60,9 @@ Function: signed_int_type
60
60
61
61
\*******************************************************************/
62
62
63
- typet signed_int_type ()
63
+ signedbv_typet signed_int_type ()
64
64
{
65
- typet result= signedbv_typet (config.ansi_c .int_width );
65
+ signedbv_typet result (config.ansi_c .int_width );
66
66
result.set (ID_C_c_type, ID_signed_int);
67
67
return result;
68
68
}
@@ -79,9 +79,9 @@ Function: signed_short_int_type
79
79
80
80
\*******************************************************************/
81
81
82
- typet signed_short_int_type ()
82
+ signedbv_typet signed_short_int_type ()
83
83
{
84
- typet result= signedbv_typet (config.ansi_c .short_int_width );
84
+ signedbv_typet result (config.ansi_c .short_int_width );
85
85
result.set (ID_C_c_type, ID_signed_short_int);
86
86
return result;
87
87
}
@@ -98,9 +98,9 @@ Function: unsigned_int_type
98
98
99
99
\*******************************************************************/
100
100
101
- typet unsigned_int_type ()
101
+ unsignedbv_typet unsigned_int_type ()
102
102
{
103
- typet result= unsignedbv_typet (config.ansi_c .int_width );
103
+ unsignedbv_typet result (config.ansi_c .int_width );
104
104
result.set (ID_C_c_type, ID_unsigned_int);
105
105
return result;
106
106
}
@@ -117,9 +117,9 @@ Function: unsigned_short_int_type
117
117
118
118
\*******************************************************************/
119
119
120
- typet unsigned_short_int_type ()
120
+ unsignedbv_typet unsigned_short_int_type ()
121
121
{
122
- typet result= unsignedbv_typet (config.ansi_c .short_int_width );
122
+ unsignedbv_typet result (config.ansi_c .short_int_width );
123
123
result.set (ID_C_c_type, ID_unsigned_short_int);
124
124
return result;
125
125
}
@@ -136,7 +136,7 @@ Function: size_type
136
136
137
137
\*******************************************************************/
138
138
139
- typet size_type ()
139
+ unsignedbv_typet size_type ()
140
140
{
141
141
// The size type varies. This is unsigned int on some systems,
142
142
// and unsigned long int on others,
@@ -164,7 +164,7 @@ Function: signed_size_type
164
164
165
165
\*******************************************************************/
166
166
167
- typet signed_size_type ()
167
+ signedbv_typet signed_size_type ()
168
168
{
169
169
// we presume this is the same as pointer difference
170
170
return pointer_diff_type ();
@@ -182,9 +182,9 @@ Function: signed_long_int_type
182
182
183
183
\*******************************************************************/
184
184
185
- typet signed_long_int_type ()
185
+ signedbv_typet signed_long_int_type ()
186
186
{
187
- typet result= signedbv_typet (config.ansi_c .long_int_width );
187
+ signedbv_typet result (config.ansi_c .long_int_width );
188
188
result.set (ID_C_c_type, ID_signed_long_int);
189
189
return result;
190
190
}
@@ -201,9 +201,9 @@ Function: signed_long_long_int_type
201
201
202
202
\*******************************************************************/
203
203
204
- typet signed_long_long_int_type ()
204
+ signedbv_typet signed_long_long_int_type ()
205
205
{
206
- typet result= signedbv_typet (config.ansi_c .long_long_int_width );
206
+ signedbv_typet result (config.ansi_c .long_long_int_width );
207
207
result.set (ID_C_c_type, ID_signed_long_long_int);
208
208
return result;
209
209
}
@@ -220,9 +220,9 @@ Function: unsigned_long_int_type
220
220
221
221
\*******************************************************************/
222
222
223
- typet unsigned_long_int_type ()
223
+ unsignedbv_typet unsigned_long_int_type ()
224
224
{
225
- typet result= unsignedbv_typet (config.ansi_c .long_int_width );
225
+ unsignedbv_typet result (config.ansi_c .long_int_width );
226
226
result.set (ID_C_c_type, ID_unsigned_long_int);
227
227
return result;
228
228
}
@@ -239,9 +239,9 @@ Function: unsigned_long_long_int_type
239
239
240
240
\*******************************************************************/
241
241
242
- typet unsigned_long_long_int_type ()
242
+ unsignedbv_typet unsigned_long_long_int_type ()
243
243
{
244
- typet result= unsignedbv_typet (config.ansi_c .long_long_int_width );
244
+ unsignedbv_typet result (config.ansi_c .long_long_int_width );
245
245
result.set (ID_C_c_type, ID_unsigned_long_long_int);
246
246
return result;
247
247
}
@@ -276,23 +276,25 @@ Function: char_type
276
276
277
277
\*******************************************************************/
278
278
279
- typet char_type ()
279
+ bitvector_typet char_type ()
280
280
{
281
- typet result;
282
-
283
281
// this can be signed or unsigned, depending on the architecture
284
282
285
- if (config.ansi_c .char_is_unsigned )
286
- result=unsignedbv_typet (config.ansi_c .char_width );
287
- else
288
- result=signedbv_typet (config.ansi_c .char_width );
289
-
290
283
// There are 3 char types, i.e., this one is
291
284
// different from either signed char or unsigned char!
292
285
293
- result.set (ID_C_c_type, ID_char);
294
-
295
- return result;
286
+ if (config.ansi_c .char_is_unsigned )
287
+ {
288
+ unsignedbv_typet result (config.ansi_c .char_width );
289
+ result.set (ID_C_c_type, ID_char);
290
+ return result;
291
+ }
292
+ else
293
+ {
294
+ signedbv_typet result (config.ansi_c .char_width );
295
+ result.set (ID_C_c_type, ID_char);
296
+ return result;
297
+ }
296
298
}
297
299
298
300
/* ******************************************************************\
@@ -307,12 +309,10 @@ Function: unsigned_char_type
307
309
308
310
\*******************************************************************/
309
311
310
- typet unsigned_char_type ()
312
+ unsignedbv_typet unsigned_char_type ()
311
313
{
312
- typet result=unsignedbv_typet (config.ansi_c .char_width );
313
-
314
+ unsignedbv_typet result (config.ansi_c .char_width );
314
315
result.set (ID_C_c_type, ID_unsigned_char);
315
-
316
316
return result;
317
317
}
318
318
@@ -328,12 +328,10 @@ Function: signed_char_type
328
328
329
329
\*******************************************************************/
330
330
331
- typet signed_char_type ()
331
+ signedbv_typet signed_char_type ()
332
332
{
333
- typet result=signedbv_typet (config.ansi_c .char_width );
334
-
333
+ signedbv_typet result (config.ansi_c .char_width );
335
334
result.set (ID_C_c_type, ID_signed_char);
336
-
337
335
return result;
338
336
}
339
337
@@ -349,18 +347,20 @@ Function: wchar_t_type
349
347
350
348
\*******************************************************************/
351
349
352
- typet wchar_t_type ()
350
+ bitvector_typet wchar_t_type ()
353
351
{
354
- typet result;
355
-
356
352
if (config.ansi_c .wchar_t_is_unsigned )
357
- result=unsignedbv_typet (config.ansi_c .wchar_t_width );
353
+ {
354
+ unsignedbv_typet result (config.ansi_c .wchar_t_width );
355
+ result.set (ID_C_c_type, ID_wchar_t);
356
+ return result;
357
+ }
358
358
else
359
- result= signedbv_typet (config. ansi_c . wchar_t_width );
360
-
361
- result.set (ID_C_c_type, ID_wchar_t);
362
-
363
- return result;
359
+ {
360
+ signedbv_typet result (config. ansi_c . wchar_t_width );
361
+ result.set (ID_C_c_type, ID_wchar_t);
362
+ return result;
363
+ }
364
364
}
365
365
366
366
/* ******************************************************************\
@@ -375,17 +375,13 @@ Function: char16_t_type
375
375
376
376
\*******************************************************************/
377
377
378
- typet char16_t_type ()
378
+ unsignedbv_typet char16_t_type ()
379
379
{
380
- typet result;
381
-
382
380
// Types char16_t and char32_t denote distinct types with the same size,
383
381
// signedness, and alignment as uint_least16_t and uint_least32_t,
384
382
// respectively, in <stdint.h>, called the underlying types.
385
- result=unsignedbv_typet (16 );
386
-
383
+ unsignedbv_typet result (16 );
387
384
result.set (ID_C_c_type, ID_char16_t);
388
-
389
385
return result;
390
386
}
391
387
@@ -401,17 +397,13 @@ Function: char32_t_type
401
397
402
398
\*******************************************************************/
403
399
404
- typet char32_t_type ()
400
+ unsignedbv_typet char32_t_type ()
405
401
{
406
- typet result;
407
-
408
402
// Types char16_t and char32_t denote distinct types with the same size,
409
403
// signedness, and alignment as uint_least16_t and uint_least32_t,
410
404
// respectively, in <stdint.h>, called the underlying types.
411
- result=unsignedbv_typet (32 );
412
-
405
+ unsignedbv_typet result (32 );
413
406
result.set (ID_C_c_type, ID_char32_t);
414
-
415
407
return result;
416
408
}
417
409
@@ -427,23 +419,23 @@ Function: float_type
427
419
428
420
\*******************************************************************/
429
421
430
- typet float_type ()
422
+ bitvector_typet float_type ()
431
423
{
432
- typet result;
433
-
434
424
if (config.ansi_c .use_fixed_for_float )
435
425
{
436
- fixedbv_typet tmp;
437
- tmp.set_width (config.ansi_c .single_width );
438
- tmp.set_integer_bits (config.ansi_c .single_width /2 );
439
- result=tmp;
426
+ fixedbv_typet result;
427
+ result.set_width (config.ansi_c .single_width );
428
+ result.set_integer_bits (config.ansi_c .single_width /2 );
429
+ result.set (ID_C_c_type, ID_float);
430
+ return result;
440
431
}
441
432
else
442
- result=ieee_float_spect::single_precision ().to_type ();
443
-
444
- result.set (ID_C_c_type, ID_float);
445
-
446
- return result;
433
+ {
434
+ floatbv_typet result=
435
+ ieee_float_spect::single_precision ().to_type ();
436
+ result.set (ID_C_c_type, ID_float);
437
+ return result;
438
+ }
447
439
}
448
440
449
441
/* ******************************************************************\
@@ -458,23 +450,23 @@ Function: double_type
458
450
459
451
\*******************************************************************/
460
452
461
- typet double_type ()
453
+ bitvector_typet double_type ()
462
454
{
463
- typet result;
464
-
465
455
if (config.ansi_c .use_fixed_for_float )
466
456
{
467
- fixedbv_typet tmp;
468
- tmp.set_width (config.ansi_c .double_width );
469
- tmp.set_integer_bits (config.ansi_c .double_width /2 );
470
- result=tmp;
457
+ fixedbv_typet result;
458
+ result.set_width (config.ansi_c .double_width );
459
+ result.set_integer_bits (config.ansi_c .double_width /2 );
460
+ result.set (ID_C_c_type, ID_double);
461
+ return result;
471
462
}
472
463
else
473
- result=ieee_float_spect::double_precision ().to_type ();
474
-
475
- result.set (ID_C_c_type, ID_double);
476
-
477
- return result;
464
+ {
465
+ floatbv_typet result=
466
+ ieee_float_spect::double_precision ().to_type ();
467
+ result.set (ID_C_c_type, ID_double);
468
+ return result;
469
+ }
478
470
}
479
471
480
472
/* ******************************************************************\
@@ -489,19 +481,19 @@ Function: long_double_type
489
481
490
482
\*******************************************************************/
491
483
492
- typet long_double_type ()
484
+ bitvector_typet long_double_type ()
493
485
{
494
- typet result;
495
-
496
486
if (config.ansi_c .use_fixed_for_float )
497
487
{
498
- fixedbv_typet tmp;
499
- tmp.set_width (config.ansi_c .long_double_width );
500
- tmp.set_integer_bits (config.ansi_c .long_double_width /2 );
501
- result=tmp;
488
+ fixedbv_typet result;
489
+ result.set_width (config.ansi_c .long_double_width );
490
+ result.set_integer_bits (config.ansi_c .long_double_width /2 );
491
+ result.set (ID_C_c_type, ID_long_double);
492
+ return result;
502
493
}
503
494
else
504
495
{
496
+ floatbv_typet result;
505
497
if (config.ansi_c .long_double_width ==128 )
506
498
result=ieee_float_spect::quadruple_precision ().to_type ();
507
499
else if (config.ansi_c .long_double_width ==64 )
@@ -520,11 +512,11 @@ typet long_double_type()
520
512
}
521
513
else
522
514
assert (false );
523
- }
524
515
525
- result.set (ID_C_c_type, ID_long_double);
516
+ result.set (ID_C_c_type, ID_long_double);
526
517
527
- return result;
518
+ return result;
519
+ }
528
520
}
529
521
530
522
/* ******************************************************************\
@@ -539,26 +531,25 @@ Function: gcc_float128_type
539
531
540
532
\*******************************************************************/
541
533
542
- typet gcc_float128_type ()
534
+ bitvector_typet gcc_float128_type ()
543
535
{
544
- typet result;
536
+ // not same as long double!
545
537
546
538
if (config.ansi_c .use_fixed_for_float )
547
539
{
548
- fixedbv_typet tmp;
549
- tmp.set_width (128 );
550
- tmp.set_integer_bits (128 /2 );
551
- result=tmp;
540
+ fixedbv_typet result;
541
+ result.set_width (128 );
542
+ result.set_integer_bits (128 /2 );
543
+ result.set (ID_C_c_type, ID_gcc_float128);
544
+ return result;
552
545
}
553
546
else
554
547
{
555
- result=ieee_float_spect::quadruple_precision ().to_type ();
548
+ floatbv_typet result=
549
+ ieee_float_spect::quadruple_precision ().to_type ();
550
+ result.set (ID_C_c_type, ID_gcc_float128);
551
+ return result;
556
552
}
557
-
558
- // not same as long double!
559
- result.set (ID_C_c_type, ID_gcc_float128);
560
-
561
- return result;
562
553
}
563
554
564
555
/* ******************************************************************\
@@ -573,7 +564,7 @@ Function: pointer_diff_type
573
564
574
565
\*******************************************************************/
575
566
576
- typet pointer_diff_type ()
567
+ signedbv_typet pointer_diff_type ()
577
568
{
578
569
// The pointer-diff type varies. This is signed int on some systems,
579
570
// and signed long int on others, and signed long long on say Windows.
@@ -600,7 +591,7 @@ Function: pointer_type
600
591
601
592
\*******************************************************************/
602
593
603
- typet pointer_type (const typet &subtype)
594
+ pointer_typet pointer_type (const typet &subtype)
604
595
{
605
596
return pointer_typet (subtype);
606
597
}
@@ -617,7 +608,7 @@ Function: reference_type
617
608
618
609
\*******************************************************************/
619
610
620
- typet reference_type (const typet &subtype)
611
+ reference_typet reference_type (const typet &subtype)
621
612
{
622
613
return reference_typet (subtype);
623
614
}
@@ -651,9 +642,9 @@ Function: gcc_unsigned_int128_type
651
642
652
643
\*******************************************************************/
653
644
654
- typet gcc_unsigned_int128_type ()
645
+ unsignedbv_typet gcc_unsigned_int128_type ()
655
646
{
656
- typet result= unsignedbv_typet (128 );
647
+ unsignedbv_typet result (128 );
657
648
result.set (ID_C_c_type, ID_unsigned_int128);
658
649
return result;
659
650
}
@@ -670,9 +661,9 @@ Function: gcc_signed_int128_type
670
661
671
662
\*******************************************************************/
672
663
673
- typet gcc_signed_int128_type ()
664
+ signedbv_typet gcc_signed_int128_type ()
674
665
{
675
- typet result= signedbv_typet (128 );
666
+ signedbv_typet result (128 );
676
667
result.set (ID_C_c_type, ID_signed_int128);
677
668
return result;
678
669
}
0 commit comments