14
14
#include < deque>
15
15
#include < unordered_set>
16
16
17
- #include < util/base_type.h>
18
17
#include < util/c_types.h>
19
18
#include < util/find_symbols.h>
20
19
#include < util/mathematical_types.h>
@@ -150,10 +149,8 @@ void linkingt::detailed_conflict_report_rec(
150
149
t1.id ()==ID_array)
151
150
{
152
151
if (
153
- depth > 0 && !base_type_eq (
154
- to_type_with_subtype (t1).subtype (),
155
- to_type_with_subtype (t2).subtype (),
156
- ns))
152
+ depth > 0 &&
153
+ to_type_with_subtype (t1).subtype () != to_type_with_subtype (t2).subtype ())
157
154
{
158
155
if (conflict_path.type ().id () == ID_pointer)
159
156
conflict_path = dereference_exprt (conflict_path);
@@ -202,7 +199,7 @@ void linkingt::detailed_conflict_report_rec(
202
199
msg+=id2string (components2[i].get_name ())+' )' ;
203
200
break ;
204
201
}
205
- else if (! base_type_eq ( subtype1, subtype2, ns) )
202
+ else if (subtype1 != subtype2 )
206
203
{
207
204
typedef std::unordered_set<typet, irep_hash> type_sett;
208
205
type_sett parent_types;
@@ -332,7 +329,7 @@ void linkingt::detailed_conflict_report_rec(
332
329
msg+=std::to_string (parameters1.size ())+' /' ;
333
330
msg+=std::to_string (parameters2.size ())+' )' ;
334
331
}
335
- else if (! base_type_eq ( return_type1, return_type2, ns) )
332
+ else if (return_type1 != return_type2 )
336
333
{
337
334
conflict_path=
338
335
index_exprt (conflict_path,
@@ -356,7 +353,7 @@ void linkingt::detailed_conflict_report_rec(
356
353
const typet &subtype1=parameters1[i].type ();
357
354
const typet &subtype2=parameters2[i].type ();
358
355
359
- if (! base_type_eq ( subtype1, subtype2, ns) )
356
+ if (subtype1 != subtype2 )
360
357
{
361
358
conflict_path=
362
359
index_exprt (conflict_path,
@@ -475,7 +472,7 @@ void linkingt::duplicate_code_symbol(
475
472
symbolt &new_symbol)
476
473
{
477
474
// Both are functions.
478
- if (! base_type_eq ( old_symbol.type , new_symbol.type , ns) )
475
+ if (old_symbol.type != new_symbol.type )
479
476
{
480
477
const code_typet &old_t =to_code_type (old_symbol.type );
481
478
const code_typet &new_t =to_code_type (new_symbol.type );
@@ -486,11 +483,8 @@ void linkingt::duplicate_code_symbol(
486
483
// casts we need to fail hard
487
484
if (old_symbol.type .get_bool (ID_C_incomplete) && old_symbol.value .is_nil ())
488
485
{
489
- if (base_type_eq (old_t .return_type (), new_t .return_type (), ns))
490
- link_warning (
491
- old_symbol,
492
- new_symbol,
493
- " implicit function declaration" );
486
+ if (old_t .return_type () == new_t .return_type ())
487
+ link_warning (old_symbol, new_symbol, " implicit function declaration" );
494
488
else
495
489
link_error (
496
490
old_symbol,
@@ -504,7 +498,7 @@ void linkingt::duplicate_code_symbol(
504
498
else if (
505
499
new_symbol.type .get_bool (ID_C_incomplete) && new_symbol.value .is_nil ())
506
500
{
507
- if (base_type_eq ( old_t .return_type (), new_t .return_type (), ns ))
501
+ if (old_t .return_type () == new_t .return_type ())
508
502
link_warning (
509
503
old_symbol,
510
504
new_symbol,
@@ -516,13 +510,12 @@ void linkingt::duplicate_code_symbol(
516
510
" implicit function declaration" );
517
511
}
518
512
// handle (incomplete) function prototypes
519
- else if (base_type_eq (old_t .return_type (), new_t .return_type (), ns) &&
520
- ((old_t .parameters ().empty () &&
521
- old_t .has_ellipsis () &&
522
- old_symbol.value .is_nil ()) ||
523
- (new_t .parameters ().empty () &&
524
- new_t .has_ellipsis () &&
525
- new_symbol.value .is_nil ())))
513
+ else if (
514
+ old_t .return_type () == new_t .return_type () &&
515
+ ((old_t .parameters ().empty () && old_t .has_ellipsis () &&
516
+ old_symbol.value .is_nil ()) ||
517
+ (new_t .parameters ().empty () && new_t .has_ellipsis () &&
518
+ new_symbol.value .is_nil ())))
526
519
{
527
520
if (old_t .parameters ().empty () &&
528
521
old_t .has_ellipsis () &&
@@ -572,9 +565,9 @@ void linkingt::duplicate_code_symbol(
572
565
}
573
566
// conflicting declarations without a definition, matching return
574
567
// types
575
- else if (base_type_eq ( old_t . return_type (), new_t . return_type (), ns) &&
576
- old_symbol.value .is_nil () &&
577
- new_symbol.value .is_nil ())
568
+ else if (
569
+ old_t . return_type () == new_t . return_type () && old_symbol.value .is_nil () &&
570
+ new_symbol.value .is_nil ())
578
571
{
579
572
link_warning (
580
573
old_symbol,
@@ -613,7 +606,7 @@ void linkingt::duplicate_code_symbol(
613
606
typedef std::deque<std::pair<typet, typet> > conflictst;
614
607
conflictst conflicts;
615
608
616
- if (! base_type_eq ( old_t .return_type (), new_t .return_type (), ns ))
609
+ if (old_t .return_type () != new_t .return_type ())
617
610
conflicts.push_back (
618
611
std::make_pair (old_t .return_type (), new_t .return_type ()));
619
612
@@ -625,7 +618,7 @@ void linkingt::duplicate_code_symbol(
625
618
n_it!=new_t .parameters ().end ();
626
619
++o_it, ++n_it)
627
620
{
628
- if (! base_type_eq ( o_it->type (), n_it->type (), ns ))
621
+ if (o_it->type () != n_it->type ())
629
622
conflicts.push_back (
630
623
std::make_pair (o_it->type (), n_it->type ()));
631
624
}
@@ -718,7 +711,7 @@ void linkingt::duplicate_code_symbol(
718
711
719
712
bool found=false ;
720
713
for (const auto &c : union_type.components ())
721
- if (base_type_eq ( c.type (), src_type, ns) )
714
+ if (c.type () == src_type )
722
715
{
723
716
found=true ;
724
717
if (warn_msg.empty ())
@@ -793,7 +786,7 @@ void linkingt::duplicate_code_symbol(
793
786
{
794
787
// ok, silently ignore
795
788
}
796
- else if (base_type_eq ( old_symbol.type , new_symbol.type , ns) )
789
+ else if (old_symbol.type == new_symbol.type )
797
790
{
798
791
// keep the one in old_symbol -- libraries come last!
799
792
debug ().source_location = new_symbol.location ;
@@ -816,7 +809,7 @@ bool linkingt::adjust_object_type_rec(
816
809
const typet &t2,
817
810
adjust_type_infot &info)
818
811
{
819
- if (base_type_eq (t1, t2, ns) )
812
+ if (t1 == t2 )
820
813
return false ;
821
814
822
815
if (
@@ -1025,7 +1018,7 @@ void linkingt::duplicate_object_symbol(
1025
1018
// both are variables
1026
1019
bool set_to_new = false ;
1027
1020
1028
- if (! base_type_eq ( old_symbol.type , new_symbol.type , ns) )
1021
+ if (old_symbol.type != new_symbol.type )
1029
1022
{
1030
1023
bool failed=
1031
1024
adjust_object_type (old_symbol, new_symbol, set_to_new);
@@ -1081,7 +1074,7 @@ void linkingt::duplicate_object_symbol(
1081
1074
simplify (tmp_old, ns);
1082
1075
simplify (tmp_new, ns);
1083
1076
1084
- if (base_type_eq ( tmp_old, tmp_new, ns) )
1077
+ if (tmp_old == tmp_new )
1085
1078
{
1086
1079
// ok, the same
1087
1080
}
@@ -1211,10 +1204,8 @@ void linkingt::duplicate_type_symbol(
1211
1204
1212
1205
if (
1213
1206
old_symbol.type .id () == ID_array && new_symbol.type .id () == ID_array &&
1214
- base_type_eq (
1215
- to_array_type (old_symbol.type ).element_type (),
1216
- to_array_type (new_symbol.type ).element_type (),
1217
- ns))
1207
+ to_array_type (old_symbol.type ).element_type () ==
1208
+ to_array_type (new_symbol.type ).element_type ())
1218
1209
{
1219
1210
if (to_array_type (old_symbol.type ).size ().is_nil () &&
1220
1211
to_array_type (new_symbol.type ).size ().is_not_nil ())
@@ -1286,10 +1277,8 @@ bool linkingt::needs_renaming_type(
1286
1277
1287
1278
if (
1288
1279
old_symbol.type .id () == ID_array && new_symbol.type .id () == ID_array &&
1289
- base_type_eq (
1290
- to_array_type (old_symbol.type ).element_type (),
1291
- to_array_type (new_symbol.type ).element_type (),
1292
- ns))
1280
+ to_array_type (old_symbol.type ).element_type () ==
1281
+ to_array_type (new_symbol.type ).element_type ())
1293
1282
{
1294
1283
if (to_array_type (old_symbol.type ).size ().is_nil () &&
1295
1284
to_array_type (new_symbol.type ).size ().is_not_nil ())
0 commit comments