1
1
/* ******************************************************************\
2
2
3
- Module:
3
+ Module: Symbol utilities
4
4
5
- Author: Daniel Kroening, kroening@kroening .com
5
+ Author: Nathan Phillips, nathan.phillips@diffblue .com
6
6
7
7
\*******************************************************************/
8
8
9
- #include " namespace_utils .h"
9
+ #include " symbol_utils .h"
10
10
#include " symbol.h"
11
11
#include < goto-programs/remove_returns.h>
12
12
13
13
/* ******************************************************************\
14
14
15
- Function: namespace_utils_baset ::does_symbol_match
15
+ Function: symbol_utilst ::does_symbol_match
16
16
17
17
Purpose:
18
18
Checks whether an exprt is actually a symbolt matching a predicate
28
28
29
29
\*******************************************************************/
30
30
31
- bool namespace_utils_baset ::does_symbol_match (
31
+ bool symbol_utilst ::does_symbol_match (
32
32
const exprt &lvalue,
33
33
std::function<bool (symbolt)> predicate) const
34
34
{
35
35
if (lvalue.id ()!=ID_symbol)
36
36
return false ;
37
37
const symbolt *symbol;
38
- if (lookup (lvalue.get (ID_identifier), symbol))
38
+ if (ns. lookup (lvalue.get (ID_identifier), symbol))
39
39
return false ;
40
40
return predicate (*symbol);
41
41
}
42
42
43
43
/* ******************************************************************\
44
44
45
- Function: namespace_utils_baset ::is_parameter
45
+ Function: symbol_utilst ::is_parameter
46
46
47
47
Purpose:
48
48
Checks whether an exprt is actually a parameter symbol
@@ -56,7 +56,7 @@ bool namespace_utils_baset::does_symbol_match(
56
56
57
57
\*******************************************************************/
58
58
59
- bool namespace_utils_baset ::is_parameter (const exprt &lvalue) const
59
+ bool symbol_utilst ::is_parameter (const exprt &lvalue) const
60
60
{
61
61
return does_symbol_match (
62
62
lvalue,
@@ -65,7 +65,7 @@ bool namespace_utils_baset::is_parameter(const exprt &lvalue) const
65
65
66
66
/* ******************************************************************\
67
67
68
- Function: namespace_utils_baset ::is_static
68
+ Function: symbol_utilst ::is_static
69
69
70
70
Purpose:
71
71
Checks whether an exprt is actually a static symbol
@@ -79,7 +79,7 @@ bool namespace_utils_baset::is_parameter(const exprt &lvalue) const
79
79
80
80
\*******************************************************************/
81
81
82
- bool namespace_utils_baset ::is_static (const exprt &lvalue) const
82
+ bool symbol_utilst ::is_static (const exprt &lvalue) const
83
83
{
84
84
// TODO: Also check for static member accesses
85
85
return does_symbol_match (
@@ -89,7 +89,7 @@ bool namespace_utils_baset::is_static(const exprt &lvalue) const
89
89
90
90
/* ******************************************************************\
91
91
92
- Function: namespace_utils_baset ::is_auxiliary_variable
92
+ Function: symbol_utilst ::is_auxiliary_variable
93
93
94
94
Purpose:
95
95
Checks whether an exprt is actually an auxiliary variable symbol
@@ -103,7 +103,7 @@ bool namespace_utils_baset::is_static(const exprt &lvalue) const
103
103
104
104
\*******************************************************************/
105
105
106
- bool namespace_utils_baset ::is_auxiliary_variable (const exprt &lvalue) const
106
+ bool symbol_utilst ::is_auxiliary_variable (const exprt &lvalue) const
107
107
{
108
108
return does_symbol_match (
109
109
lvalue,
@@ -112,7 +112,7 @@ bool namespace_utils_baset::is_auxiliary_variable(const exprt &lvalue) const
112
112
113
113
/* ******************************************************************\
114
114
115
- Function: namespace_utils_baset ::is_return_value_auxiliary
115
+ Function: symbol_utilst ::is_return_value_auxiliary
116
116
117
117
Purpose:
118
118
Checks whether an exprt is actually an auxiliary return value symbol
@@ -126,7 +126,7 @@ bool namespace_utils_baset::is_auxiliary_variable(const exprt &lvalue) const
126
126
127
127
\*******************************************************************/
128
128
129
- bool namespace_utils_baset ::is_return_value_auxiliary (const exprt &lvalue) const
129
+ bool symbol_utilst ::is_return_value_auxiliary (const exprt &lvalue) const
130
130
{
131
131
return
132
132
does_symbol_match (
0 commit comments