Skip to content

Commit ecd484c

Browse files
author
Daniel Kroening
committed
remove base_type_eq and type_eq
These are no longer needed, as symbol_type is no longer in use.
1 parent e2b42b8 commit ecd484c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+126
-641
lines changed

jbmc/unit/java-testing-utils/require_type.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Author: Diffblue Ltd.
99
#include "require_type.h"
1010

1111
#include <testing-utils/use_catch.h>
12-
#include <util/base_type.h>
1312
#include <util/namespace.h>
1413
#include <util/symbol_table.h>
1514

@@ -26,10 +25,8 @@ pointer_typet require_type::require_pointer(
2625
const pointer_typet &pointer = to_pointer_type(type);
2726

2827
if(subtype)
29-
{
30-
namespacet ns{symbol_tablet{}};
31-
base_type_eq(pointer.subtype(), subtype.value(), ns);
32-
}
28+
REQUIRE(pointer.subtype() == subtype.value());
29+
3330
return pointer;
3431
}
3532

src/analyses/constant_propagator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Author: Peter Schrammel
1717
#endif
1818

1919
#include <util/arith_tools.h>
20-
#include <util/base_type.h>
2120
#include <util/c_types.h>
2221
#include <util/cprover_prefix.h>
2322
#include <util/expr_util.h>
@@ -103,7 +102,7 @@ void constant_propagator_domaint::assign_rec(
103102
if(dest_values.is_constant(tmp))
104103
{
105104
DATA_INVARIANT(
106-
base_type_eq(ns.lookup(s).type, tmp.type(), ns),
105+
ns.lookup(s).type == tmp.type(),
107106
"type of constant to be replaced should match");
108107
dest_values.set_to(s, tmp);
109108
}
@@ -623,7 +622,7 @@ bool constant_propagator_domaint::valuest::meet(
623622
{
624623
const typet &m_id_type = ns.lookup(m.first).type;
625624
DATA_INVARIANT(
626-
base_type_eq(m_id_type, m.second.type(), ns),
625+
m_id_type == m.second.type(),
627626
"type of constant to be stored should match");
628627
set_to(symbol_exprt(m.first, m_id_type), m.second);
629628
changed=true;

src/analyses/does_remove_const.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Author: Diffblue Ltd.
1515
#include <util/type.h>
1616
#include <util/expr.h>
1717
#include <util/std_code.h>
18-
#include <util/base_type.h>
1918

2019
/// A naive analysis to look for casts that remove const-ness from pointers.
2120
/// \param goto_program: the goto program to check
@@ -74,7 +73,7 @@ bool does_remove_constt::does_expr_lose_const(const exprt &expr) const
7473
for(const exprt &op : expr.operands())
7574
{
7675
const typet &op_type=op.type();
77-
if(base_type_eq(op_type, root_type, ns))
76+
if(op_type == root_type)
7877
{
7978
// Is this child more const-qualified than the root
8079
if(!does_type_preserve_const_correctness(&root_type, &op_type))

src/analyses/goto_check.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Author: Daniel Kroening, [email protected]
1515

1616
#include <util/arith_tools.h>
1717
#include <util/array_name.h>
18-
#include <util/base_type.h>
1918
#include <util/c_types.h>
2019
#include <util/config.h>
2120
#include <util/cprover_prefix.h>

src/analyses/invariant_propagation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
1212
#include "invariant_propagation.h"
1313

1414
#include <util/simplify_expr.h>
15-
#include <util/base_type.h>
1615
#include <util/symbol_table.h>
1716
#include <util/std_expr.h>
1817

src/analyses/invariant_set.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Author: Daniel Kroening, [email protected]
1515

1616
#include <util/arith_tools.h>
1717
#include <util/base_exceptions.h>
18-
#include <util/base_type.h>
1918
#include <util/c_types.h>
2019
#include <util/expr_util.h>
2120
#include <util/namespace.h>

src/analyses/local_safe_pointers.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Author: Diffblue Ltd
1111

1212
#include "local_safe_pointers.h"
1313

14-
#include <util/base_type.h>
1514
#include <util/expr_iterator.h>
1615
#include <util/expr_util.h>
1716
#include <util/format_expr.h>
@@ -275,7 +274,7 @@ bool local_safe_pointerst::is_non_null_at_program_point(
275274
bool local_safe_pointerst::base_type_comparet::operator()(
276275
const exprt &e1, const exprt &e2) const
277276
{
278-
if(base_type_eq(e1, e2, ns))
277+
if(e1 == e2)
279278
return false;
280279
else
281280
return e1 < e2;

src/ansi-c/c_typecast.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Author: Daniel Kroening, [email protected]
1313
#include <cassert>
1414

1515
#include <util/arith_tools.h>
16-
#include <util/base_type.h>
1716
#include <util/c_types.h>
1817
#include <util/config.h>
1918
#include <util/expr_util.h>
@@ -551,7 +550,7 @@ void c_typecastt::implicit_typecast_followed(
551550
// very generous:
552551
// between any two function pointers it's ok
553552
}
554-
else if(base_type_eq(src_sub, dest_sub, ns))
553+
else if(src_sub == dest_sub)
555554
{
556555
// ok
557556
}
@@ -567,7 +566,7 @@ void c_typecastt::implicit_typecast_followed(
567566
}
568567
else if(src_sub.id()==ID_array &&
569568
dest_sub.id()==ID_array &&
570-
base_type_eq(src_sub.subtype(), dest_sub.subtype(), ns))
569+
src_sub.subtype() == dest_sub.subtype())
571570
{
572571
// we ignore the size of the top-level array
573572
// in the case of pointers to arrays

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Author: Daniel Kroening, [email protected]
1414
#include <cassert>
1515

1616
#include <util/arith_tools.h>
17-
#include <util/base_type.h>
1817
#include <util/c_types.h>
1918
#include <util/config.h>
2019
#include <util/cprover_prefix.h>
@@ -1065,7 +1064,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
10651064
const typet expr_type=follow(expr.type());
10661065

10671066
if(expr_type.id()==ID_union &&
1068-
!base_type_eq(expr_type, op.type(), *this) &&
1067+
expr_type != op.type() &&
10691068
op.id()!=ID_initializer_list)
10701069
{
10711070
// This is a GCC extension. It's either a 'temporary union',
@@ -1080,7 +1079,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
10801079
// we need to find a member with the right type
10811080
for(const auto &c : to_union_type(expr_type).components())
10821081
{
1083-
if(base_type_eq(c.type(), op.type(), *this))
1082+
if(c.type() == op.type())
10841083
{
10851084
// found! build union constructor
10861085
union_exprt union_expr(c.get_name(), op, expr.type());
@@ -1131,7 +1130,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
11311130
const typet op_type = op.type();
11321131

11331132
// cast to same type?
1134-
if(base_type_eq(expr_type, op_type, *this))
1133+
if(expr_type == op_type)
11351134
return; // it's ok
11361135

11371136
// vectors?
@@ -2516,8 +2515,8 @@ exprt c_typecheck_baset::do_special_functions(
25162515
expr.arguments().front(), expr.arguments().back());
25172516
equality_expr.add_source_location()=source_location;
25182517

2519-
if(!base_type_eq(equality_expr.lhs().type(),
2520-
equality_expr.rhs().type(), *this))
2518+
if(equality_expr.lhs().type() !=
2519+
equality_expr.rhs().type())
25212520
{
25222521
error().source_location = f_op.source_location();
25232522
error() << "equal expects two operands of same type" << eom;

src/ansi-c/c_typecheck_initializer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Author: Daniel Kroening, [email protected]
1919
#include <util/simplify_expr.h>
2020
#include <util/std_types.h>
2121
#include <util/string_constant.h>
22-
#include <util/type_eq.h>
2322

2423
#include "anonymous_member.h"
2524

0 commit comments

Comments
 (0)