Skip to content

Commit 4e159b2

Browse files
committed
Move definition of base_type_eqt to .cpp
This is an implementation detail that need not be exposed to users - the interface is the free function base_type_eq.
1 parent 3244212 commit 4e159b2

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

src/util/base_type.cpp

+33
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,39 @@ Author: Daniel Kroening, [email protected]
1717
#include "std_types.h"
1818
#include "namespace.h"
1919
#include "symbol.h"
20+
#include "union_find.h"
21+
22+
class base_type_eqt
23+
{
24+
public:
25+
explicit base_type_eqt(const namespacet &_ns):ns(_ns)
26+
{
27+
}
28+
29+
bool base_type_eq(const typet &type1, const typet &type2)
30+
{
31+
identifiers.clear();
32+
return base_type_eq_rec(type1, type2);
33+
}
34+
35+
bool base_type_eq(const exprt &expr1, const exprt &expr2)
36+
{
37+
identifiers.clear();
38+
return base_type_eq_rec(expr1, expr2);
39+
}
40+
41+
virtual ~base_type_eqt() { }
42+
43+
protected:
44+
const namespacet &ns;
45+
46+
virtual bool base_type_eq_rec(const typet &type1, const typet &type2);
47+
virtual bool base_type_eq_rec(const exprt &expr1, const exprt &expr2);
48+
49+
// for loop avoidance
50+
typedef union_find<irep_idt> identifierst;
51+
identifierst identifiers;
52+
};
2053

2154
void base_type_rec(
2255
typet &type, const namespacet &ns, std::set<irep_idt> &symb)

src/util/base_type.h

-35
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ Author: Daniel Kroening, [email protected]
1212
#ifndef CPROVER_UTIL_BASE_TYPE_H
1313
#define CPROVER_UTIL_BASE_TYPE_H
1414

15-
#include "union_find.h"
16-
#include "irep.h"
17-
1815
class exprt;
1916
class typet;
2017
class namespacet;
@@ -29,36 +26,4 @@ bool base_type_eq(
2926
const exprt &expr2,
3027
const namespacet &ns);
3128

32-
class base_type_eqt
33-
{
34-
public:
35-
explicit base_type_eqt(const namespacet &_ns):ns(_ns)
36-
{
37-
}
38-
39-
bool base_type_eq(const typet &type1, const typet &type2)
40-
{
41-
identifiers.clear();
42-
return base_type_eq_rec(type1, type2);
43-
}
44-
45-
bool base_type_eq(const exprt &expr1, const exprt &expr2)
46-
{
47-
identifiers.clear();
48-
return base_type_eq_rec(expr1, expr2);
49-
}
50-
51-
virtual ~base_type_eqt() { }
52-
53-
protected:
54-
const namespacet &ns;
55-
56-
virtual bool base_type_eq_rec(const typet &type1, const typet &type2);
57-
virtual bool base_type_eq_rec(const exprt &expr1, const exprt &expr2);
58-
59-
// for loop avoidance
60-
typedef union_find<irep_idt> identifierst;
61-
identifierst identifiers;
62-
};
63-
6429
#endif // CPROVER_UTIL_BASE_TYPE_H

0 commit comments

Comments
 (0)