14
14
#include < deque>
15
15
#include < unordered_set>
16
16
17
- #include < util/base_type.h>
18
17
#include < util/find_symbols.h>
19
18
#include < util/mathematical_types.h>
20
19
#include < util/pointer_offset_size.h>
@@ -139,8 +138,7 @@ void linkingt::detailed_conflict_report_rec(
139
138
else if (t1.id ()==ID_pointer ||
140
139
t1.id ()==ID_array)
141
140
{
142
- if (depth>0 &&
143
- !base_type_eq (t1.subtype (), t2.subtype (), ns))
141
+ if (depth > 0 && t1.subtype () != t2.subtype ())
144
142
{
145
143
if (conflict_path.type ().id () == ID_pointer)
146
144
conflict_path = dereference_exprt (conflict_path);
@@ -189,7 +187,7 @@ void linkingt::detailed_conflict_report_rec(
189
187
msg+=id2string (components2[i].get_name ())+' )' ;
190
188
break ;
191
189
}
192
- else if (! base_type_eq ( subtype1, subtype2, ns) )
190
+ else if (subtype1 != subtype2 )
193
191
{
194
192
typedef std::unordered_set<typet, irep_hash> type_sett;
195
193
type_sett parent_types;
@@ -313,7 +311,7 @@ void linkingt::detailed_conflict_report_rec(
313
311
msg+=std::to_string (parameters1.size ())+' /' ;
314
312
msg+=std::to_string (parameters2.size ())+' )' ;
315
313
}
316
- else if (! base_type_eq ( return_type1, return_type2, ns) )
314
+ else if (return_type1 != return_type2 )
317
315
{
318
316
conflict_path=
319
317
index_exprt (conflict_path,
@@ -337,7 +335,7 @@ void linkingt::detailed_conflict_report_rec(
337
335
const typet &subtype1=parameters1[i].type ();
338
336
const typet &subtype2=parameters2[i].type ();
339
337
340
- if (! base_type_eq ( subtype1, subtype2, ns) )
338
+ if (subtype1 != subtype2 )
341
339
{
342
340
conflict_path=
343
341
index_exprt (conflict_path,
@@ -456,7 +454,7 @@ void linkingt::duplicate_code_symbol(
456
454
symbolt &new_symbol)
457
455
{
458
456
// Both are functions.
459
- if (! base_type_eq ( old_symbol.type , new_symbol.type , ns) )
457
+ if (old_symbol.type != new_symbol.type )
460
458
{
461
459
const code_typet &old_t =to_code_type (old_symbol.type );
462
460
const code_typet &new_t =to_code_type (new_symbol.type );
@@ -467,11 +465,8 @@ void linkingt::duplicate_code_symbol(
467
465
// casts we need to fail hard
468
466
if (old_symbol.type .get_bool (ID_C_incomplete) && old_symbol.value .is_nil ())
469
467
{
470
- if (base_type_eq (old_t .return_type (), new_t .return_type (), ns))
471
- link_warning (
472
- old_symbol,
473
- new_symbol,
474
- " implicit function declaration" );
468
+ if (old_t .return_type () == new_t .return_type ())
469
+ link_warning (old_symbol, new_symbol, " implicit function declaration" );
475
470
else
476
471
link_error (
477
472
old_symbol,
@@ -485,7 +480,7 @@ void linkingt::duplicate_code_symbol(
485
480
else if (
486
481
new_symbol.type .get_bool (ID_C_incomplete) && new_symbol.value .is_nil ())
487
482
{
488
- if (base_type_eq ( old_t .return_type (), new_t .return_type (), ns ))
483
+ if (old_t .return_type () == new_t .return_type ())
489
484
link_warning (
490
485
old_symbol,
491
486
new_symbol,
@@ -497,13 +492,12 @@ void linkingt::duplicate_code_symbol(
497
492
" implicit function declaration" );
498
493
}
499
494
// handle (incomplete) function prototypes
500
- else if (base_type_eq (old_t .return_type (), new_t .return_type (), ns) &&
501
- ((old_t .parameters ().empty () &&
502
- old_t .has_ellipsis () &&
503
- old_symbol.value .is_nil ()) ||
504
- (new_t .parameters ().empty () &&
505
- new_t .has_ellipsis () &&
506
- new_symbol.value .is_nil ())))
495
+ else if (
496
+ old_t .return_type () == new_t .return_type () &&
497
+ ((old_t .parameters ().empty () && old_t .has_ellipsis () &&
498
+ old_symbol.value .is_nil ()) ||
499
+ (new_t .parameters ().empty () && new_t .has_ellipsis () &&
500
+ new_symbol.value .is_nil ())))
507
501
{
508
502
if (old_t .parameters ().empty () &&
509
503
old_t .has_ellipsis () &&
@@ -553,9 +547,9 @@ void linkingt::duplicate_code_symbol(
553
547
}
554
548
// conflicting declarations without a definition, matching return
555
549
// types
556
- else if (base_type_eq ( old_t . return_type (), new_t . return_type (), ns) &&
557
- old_symbol.value .is_nil () &&
558
- new_symbol.value .is_nil ())
550
+ else if (
551
+ old_t . return_type () == new_t . return_type () && old_symbol.value .is_nil () &&
552
+ new_symbol.value .is_nil ())
559
553
{
560
554
link_warning (
561
555
old_symbol,
@@ -594,7 +588,7 @@ void linkingt::duplicate_code_symbol(
594
588
typedef std::deque<std::pair<typet, typet> > conflictst;
595
589
conflictst conflicts;
596
590
597
- if (! base_type_eq ( old_t .return_type (), new_t .return_type (), ns ))
591
+ if (old_t .return_type () != new_t .return_type ())
598
592
conflicts.push_back (
599
593
std::make_pair (old_t .return_type (), new_t .return_type ()));
600
594
@@ -606,7 +600,7 @@ void linkingt::duplicate_code_symbol(
606
600
n_it!=new_t .parameters ().end ();
607
601
++o_it, ++n_it)
608
602
{
609
- if (! base_type_eq ( o_it->type (), n_it->type (), ns ))
603
+ if (o_it->type () != n_it->type ())
610
604
conflicts.push_back (
611
605
std::make_pair (o_it->type (), n_it->type ()));
612
606
}
@@ -699,7 +693,7 @@ void linkingt::duplicate_code_symbol(
699
693
700
694
bool found=false ;
701
695
for (const auto &c : union_type.components ())
702
- if (base_type_eq ( c.type (), src_type, ns) )
696
+ if (c.type () == src_type )
703
697
{
704
698
found=true ;
705
699
if (warn_msg.empty ())
@@ -774,7 +768,7 @@ void linkingt::duplicate_code_symbol(
774
768
{
775
769
// ok, silently ignore
776
770
}
777
- else if (base_type_eq ( old_symbol.type , new_symbol.type , ns) )
771
+ else if (old_symbol.type == new_symbol.type )
778
772
{
779
773
// keep the one in old_symbol -- libraries come last!
780
774
warning ().source_location =new_symbol.location ;
@@ -797,7 +791,7 @@ bool linkingt::adjust_object_type_rec(
797
791
const typet &t2,
798
792
adjust_type_infot &info)
799
793
{
800
- if (base_type_eq (t1, t2, ns) )
794
+ if (t1 == t2 )
801
795
return false ;
802
796
803
797
if (
@@ -993,7 +987,7 @@ void linkingt::duplicate_object_symbol(
993
987
// both are variables
994
988
bool set_to_new = false ;
995
989
996
- if (! base_type_eq ( old_symbol.type , new_symbol.type , ns) )
990
+ if (old_symbol.type != new_symbol.type )
997
991
{
998
992
bool failed=
999
993
adjust_object_type (old_symbol, new_symbol, set_to_new);
@@ -1051,7 +1045,7 @@ void linkingt::duplicate_object_symbol(
1051
1045
simplify (tmp_old, ns);
1052
1046
simplify (tmp_new, ns);
1053
1047
1054
- if (base_type_eq ( tmp_old, tmp_new, ns) )
1048
+ if (tmp_old == tmp_new )
1055
1049
{
1056
1050
// ok, the same
1057
1051
}
@@ -1176,9 +1170,9 @@ void linkingt::duplicate_type_symbol(
1176
1170
return ;
1177
1171
}
1178
1172
1179
- if (old_symbol. type . id ()==ID_array &&
1180
- new_symbol.type .id ()== ID_array &&
1181
- base_type_eq ( old_symbol.type .subtype (), new_symbol.type .subtype (), ns ))
1173
+ if (
1174
+ old_symbol. type . id () == ID_array && new_symbol.type .id () == ID_array &&
1175
+ old_symbol.type .subtype () == new_symbol.type .subtype ())
1182
1176
{
1183
1177
if (to_array_type (old_symbol.type ).size ().is_nil () &&
1184
1178
to_array_type (new_symbol.type ).size ().is_not_nil ())
@@ -1248,9 +1242,9 @@ bool linkingt::needs_renaming_type(
1248
1242
to_union_type (new_symbol.type ).is_incomplete ())
1249
1243
return false ; // not different
1250
1244
1251
- if (old_symbol. type . id ()==ID_array &&
1252
- new_symbol.type .id ()== ID_array &&
1253
- base_type_eq ( old_symbol.type .subtype (), new_symbol.type .subtype (), ns ))
1245
+ if (
1246
+ old_symbol. type . id () == ID_array && new_symbol.type .id () == ID_array &&
1247
+ old_symbol.type .subtype () == new_symbol.type .subtype ())
1254
1248
{
1255
1249
if (to_array_type (old_symbol.type ).size ().is_nil () &&
1256
1250
to_array_type (new_symbol.type ).size ().is_not_nil ())
0 commit comments