Skip to content

Commit a9e8d4b

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 bc86a60 commit a9e8d4b

Some content is hidden

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

54 files changed

+151
-668
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/goto-instrument/dump_c.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "dump_c.h"
1313

14-
#include <util/base_type.h>
1514
#include <util/config.h>
1615
#include <util/find_symbols.h>
1716
#include <util/invariant.h>
@@ -1277,9 +1276,9 @@ void dump_ct::cleanup_expr(exprt &expr)
12771276
expr.swap(tmp);
12781277
}
12791278
}
1280-
else if(expr.id()==ID_typecast &&
1281-
expr.op0().id()==ID_typecast &&
1282-
base_type_eq(expr.type(), expr.op0().type(), ns))
1279+
else if(
1280+
expr.id() == ID_typecast && expr.op0().id() == ID_typecast &&
1281+
expr.type() == expr.op0().type())
12831282
{
12841283
exprt tmp=expr.op0();
12851284
expr.swap(tmp);
@@ -1309,8 +1308,7 @@ void dump_ct::cleanup_expr(exprt &expr)
13091308
if(type.id()==ID_union &&
13101309
type.get_bool(ID_C_transparent_union))
13111310
{
1312-
if(it2->id()==ID_typecast &&
1313-
base_type_eq(it2->type(), type, ns))
1311+
if(it2->id() == ID_typecast && it2->type() == type)
13141312
*it2=to_typecast_expr(*it2).op();
13151313

13161314
// add a typecast for NULL or 0

src/goto-instrument/goto_program2code.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/find_symbols.h>
2121
#include <util/prefix.h>
2222
#include <util/simplify_expr.h>
23-
#include <util/type_eq.h>
2423

2524
void goto_program2codet::operator()()
2625
{
@@ -1875,7 +1874,7 @@ void goto_program2codet::cleanup_expr(exprt &expr, bool no_typecast)
18751874
if(!has_prefix(id2string(it->second.base_name), "nondet_"))
18761875
continue;
18771876
const code_typet &code_type=to_code_type(it->second.type);
1878-
if(!type_eq(code_type.return_type(), expr.type(), ns))
1877+
if(code_type.return_type() != expr.type())
18791878
continue;
18801879
if(!code_type.parameters().empty())
18811880
continue;

src/goto-programs/goto_convert_functions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Date: June 2003
1010

1111
#include "goto_convert_functions.h"
1212

13-
#include <util/base_type.h>
1413
#include <util/fresh_symbol.h>
1514
#include <util/prefix.h>
1615
#include <util/std_code.h>

0 commit comments

Comments
 (0)