@@ -18,13 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com
18
18
19
19
#include " gcc_types.h"
20
20
21
- void ansi_c_convert_typet::read (const typet &type)
22
- {
23
- clear ();
24
- source_location=type.source_location ();
25
- read_rec (type);
26
- }
27
-
28
21
void ansi_c_convert_typet::read_rec (const typet &type)
29
22
{
30
23
if (type.id ()==ID_merged_type)
@@ -298,6 +291,8 @@ void ansi_c_convert_typet::read_rec(const typet &type)
298
291
299
292
void ansi_c_convert_typet::write (typet &type)
300
293
{
294
+ messaget log{message_handler};
295
+
301
296
type.clear ();
302
297
303
298
// first, do "other"
@@ -314,8 +309,8 @@ void ansi_c_convert_typet::write(typet &type)
314
309
gcc_float128_cnt || gcc_float128x_cnt ||
315
310
gcc_int128_cnt || bv_cnt)
316
311
{
317
- error ().source_location = source_location;
318
- error () << " illegal type modifier for defined type" << eom;
312
+ log. error ().source_location = source_location;
313
+ log. error () << " illegal type modifier for defined type" << messaget:: eom;
319
314
throw 0 ;
320
315
}
321
316
@@ -330,8 +325,8 @@ void ansi_c_convert_typet::write(typet &type)
330
325
331
326
if (other.size ()!=1 )
332
327
{
333
- error ().source_location = source_location;
334
- error () << " illegal combination of defined types" << eom;
328
+ log. error ().source_location = source_location;
329
+ log. error () << " illegal combination of defined types" << messaget:: eom;
335
330
throw 0 ;
336
331
}
337
332
@@ -362,9 +357,9 @@ void ansi_c_convert_typet::write(typet &type)
362
357
{
363
358
if (constructor && destructor)
364
359
{
365
- error ().source_location = source_location;
366
- error () << " combining constructor and destructor not supported"
367
- << eom;
360
+ log. error ().source_location = source_location;
361
+ log. error () << " combining constructor and destructor not supported"
362
+ << messaget:: eom;
368
363
throw 0 ;
369
364
}
370
365
@@ -374,9 +369,9 @@ void ansi_c_convert_typet::write(typet &type)
374
369
375
370
else if (type_p->id ()!=ID_empty)
376
371
{
377
- error ().source_location = source_location;
378
- error () << " constructor and destructor required to be type void, "
379
- << " found " << type_p->pretty () << eom;
372
+ log. error ().source_location = source_location;
373
+ log. error () << " constructor and destructor required to be type void, "
374
+ << " found " << type_p->pretty () << messaget:: eom;
380
375
throw 0 ;
381
376
}
382
377
@@ -385,9 +380,9 @@ void ansi_c_convert_typet::write(typet &type)
385
380
}
386
381
else if (constructor || destructor)
387
382
{
388
- error ().source_location = source_location;
389
- error () << " constructor and destructor required to be type void, "
390
- << " found " << type.pretty () << eom;
383
+ log. error ().source_location = source_location;
384
+ log. error () << " constructor and destructor required to be type void, "
385
+ << " found " << type.pretty () << messaget:: eom;
391
386
throw 0 ;
392
387
}
393
388
else if (gcc_float16_cnt ||
@@ -400,8 +395,9 @@ void ansi_c_convert_typet::write(typet &type)
400
395
gcc_int128_cnt || bv_cnt ||
401
396
short_cnt || char_cnt)
402
397
{
403
- error ().source_location =source_location;
404
- error () << " cannot combine integer type with floating-point type" << eom;
398
+ log.error ().source_location = source_location;
399
+ log.error () << " cannot combine integer type with floating-point type"
400
+ << messaget::eom;
405
401
throw 0 ;
406
402
}
407
403
@@ -411,8 +407,8 @@ void ansi_c_convert_typet::write(typet &type)
411
407
gcc_float64_cnt+gcc_float64x_cnt+
412
408
gcc_float128_cnt+gcc_float128x_cnt>=2 )
413
409
{
414
- error ().source_location = source_location;
415
- error () << " conflicting type modifiers" << eom;
410
+ log. error ().source_location = source_location;
411
+ log. error () << " conflicting type modifiers" << messaget:: eom;
416
412
throw 0 ;
417
413
}
418
414
@@ -441,15 +437,16 @@ void ansi_c_convert_typet::write(typet &type)
441
437
gcc_int128_cnt|| bv_cnt ||
442
438
short_cnt || char_cnt)
443
439
{
444
- error ().source_location =source_location;
445
- error () << " cannot combine integer type with floating-point type" << eom;
440
+ log.error ().source_location = source_location;
441
+ log.error () << " cannot combine integer type with floating-point type"
442
+ << messaget::eom;
446
443
throw 0 ;
447
444
}
448
445
449
446
if (double_cnt && float_cnt)
450
447
{
451
- error ().source_location = source_location;
452
- error () << " conflicting type modifiers" << eom;
448
+ log. error ().source_location = source_location;
449
+ log. error () << " conflicting type modifiers" << messaget:: eom;
453
450
throw 0 ;
454
451
}
455
452
@@ -466,15 +463,15 @@ void ansi_c_convert_typet::write(typet &type)
466
463
type=long_double_type ();
467
464
else
468
465
{
469
- error ().source_location = source_location;
470
- error () << " conflicting type modifiers" << eom;
466
+ log. error ().source_location = source_location;
467
+ log. error () << " conflicting type modifiers" << messaget:: eom;
471
468
throw 0 ;
472
469
}
473
470
}
474
471
else
475
472
{
476
- error ().source_location = source_location;
477
- error () << " illegal type modifier for float" << eom;
473
+ log. error ().source_location = source_location;
474
+ log. error () << " illegal type modifier for float" << messaget:: eom;
478
475
throw 0 ;
479
476
}
480
477
}
@@ -485,8 +482,9 @@ void ansi_c_convert_typet::write(typet &type)
485
482
gcc_float128_cnt || bv_cnt || proper_bool_cnt ||
486
483
char_cnt || long_cnt)
487
484
{
488
- error ().source_location =source_location;
489
- error () << " illegal type modifier for C boolean type" << eom;
485
+ log.error ().source_location = source_location;
486
+ log.error () << " illegal type modifier for C boolean type"
487
+ << messaget::eom;
490
488
throw 0 ;
491
489
}
492
490
@@ -499,8 +497,9 @@ void ansi_c_convert_typet::write(typet &type)
499
497
gcc_float128_cnt || bv_cnt ||
500
498
char_cnt || long_cnt)
501
499
{
502
- error ().source_location =source_location;
503
- error () << " illegal type modifier for proper boolean type" << eom;
500
+ log.error ().source_location = source_location;
501
+ log.error () << " illegal type modifier for proper boolean type"
502
+ << messaget::eom;
504
503
throw 0 ;
505
504
}
506
505
@@ -518,15 +517,15 @@ void ansi_c_convert_typet::write(typet &type)
518
517
int8_cnt || int16_cnt || int32_cnt || int64_cnt ||
519
518
gcc_float128_cnt || bv_cnt || proper_bool_cnt)
520
519
{
521
- error ().source_location = source_location;
522
- error () << " illegal type modifier for char type" << eom;
520
+ log. error ().source_location = source_location;
521
+ log. error () << " illegal type modifier for char type" << messaget:: eom;
523
522
throw 0 ;
524
523
}
525
524
526
525
if (signed_cnt && unsigned_cnt)
527
526
{
528
- error ().source_location = source_location;
529
- error () << " conflicting type modifiers" << eom;
527
+ log. error ().source_location = source_location;
528
+ log. error () << " conflicting type modifiers" << messaget:: eom;
530
529
throw 0 ;
531
530
}
532
531
else if (unsigned_cnt)
@@ -544,8 +543,8 @@ void ansi_c_convert_typet::write(typet &type)
544
543
545
544
if (signed_cnt && unsigned_cnt)
546
545
{
547
- error ().source_location = source_location;
548
- error () << " conflicting type modifiers" << eom;
546
+ log. error ().source_location = source_location;
547
+ log. error () << " conflicting type modifiers" << messaget:: eom;
549
548
throw 0 ;
550
549
}
551
550
else if (unsigned_cnt)
@@ -557,8 +556,8 @@ void ansi_c_convert_typet::write(typet &type)
557
556
{
558
557
if (long_cnt || char_cnt || short_cnt || gcc_int128_cnt || bv_cnt)
559
558
{
560
- error ().source_location = source_location;
561
- error () << " conflicting type modifiers" << eom;
559
+ log. error ().source_location = source_location;
560
+ log. error () << " conflicting type modifiers" << messaget:: eom;
562
561
throw 0 ;
563
562
}
564
563
@@ -614,8 +613,8 @@ void ansi_c_convert_typet::write(typet &type)
614
613
{
615
614
if (long_cnt || char_cnt)
616
615
{
617
- error ().source_location = source_location;
618
- error () << " conflicting type modifiers" << eom;
616
+ log. error ().source_location = source_location;
617
+ log. error () << " conflicting type modifiers" << messaget:: eom;
619
618
throw 0 ;
620
619
}
621
620
@@ -647,8 +646,8 @@ void ansi_c_convert_typet::write(typet &type)
647
646
}
648
647
else
649
648
{
650
- error ().source_location = source_location;
651
- error () << " illegal type modifier for integer type" << eom;
649
+ log. error ().source_location = source_location;
650
+ log. error () << " illegal type modifier for integer type" << messaget:: eom;
652
651
throw 0 ;
653
652
}
654
653
}
0 commit comments