Skip to content

Commit aa3d52b

Browse files
committed
Rename kindt to symbol_kindt for clarity
This is just a change in the enum tag.
1 parent fcb6b23 commit aa3d52b

File tree

5 files changed

+35
-31
lines changed

5 files changed

+35
-31
lines changed

src/ansi-c/goto_check_c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void goto_check_ct::invalidate(const exprt &lhs)
466466
for(auto it = assertions.begin(); it != assertions.end();)
467467
{
468468
if(
469-
has_symbol(it->second, lhs_id, kindt::F_EXPR) ||
469+
has_symbol(it->second, lhs_id, symbol_kindt::F_EXPR) ||
470470
has_subexpr(it->second, ID_dereference))
471471
{
472472
it = assertions.erase(it);

src/goto-symex/postcondition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ bool postconditiont::is_used(
167167
for(const exprt &e :
168168
value_set.get_value_set(to_dereference_expr(expr).pointer(), ns))
169169
{
170-
if(has_symbol(get_original_name(e), identifier, kindt::F_EXPR))
170+
if(has_symbol(get_original_name(e), identifier, symbol_kindt::F_EXPR))
171171
{
172172
return true;
173173
}

src/goto-symex/precondition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void preconditiont::compute_rec(exprt &dest)
117117
for(const exprt &e : value_sets.get_values(
118118
SSA_step.source.function_id, target, deref_expr.pointer()))
119119
{
120-
if(has_symbol(e, lhs_identifier, kindt::F_EXPR))
120+
if(has_symbol(e, lhs_identifier, symbol_kindt::F_EXPR))
121121
{
122122
may_alias = true;
123123
break;

src/util/find_symbols.cpp

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ bool has_symbol(const exprt &src, const find_symbols_sett &symbols)
2828
}
2929

3030
static bool find_symbols(
31-
kindt,
31+
symbol_kindt,
3232
const typet &,
3333
std::function<bool(const symbol_exprt &)>);
3434

3535
static bool find_symbols(
36-
kindt kind,
36+
symbol_kindt kind,
3737
const exprt &src,
3838
std::function<bool(const symbol_exprt &)> op)
3939
{
@@ -46,7 +46,7 @@ static bool find_symbols(
4646
if(!find_symbols(kind, src.type(), op))
4747
return false;
4848

49-
if(kind == kindt::F_ALL || kind == kindt::F_EXPR)
49+
if(kind == symbol_kindt::F_ALL || kind == symbol_kindt::F_EXPR)
5050
{
5151
if(src.id() == ID_symbol && !op(to_symbol_expr(src)))
5252
return false;
@@ -74,12 +74,11 @@ static bool find_symbols(
7474
}
7575

7676
static bool find_symbols(
77-
kindt kind,
77+
symbol_kindt kind,
7878
const typet &src,
7979
std::function<bool(const symbol_exprt &)> op)
8080
{
81-
if(kind!=kindt::F_TYPE_NON_PTR ||
82-
src.id()!=ID_pointer)
81+
if(kind != symbol_kindt::F_TYPE_NON_PTR || src.id() != ID_pointer)
8382
{
8483
if(
8584
src.has_subtype() &&
@@ -95,8 +94,8 @@ static bool find_symbols(
9594
}
9695

9796
if(
98-
kind == kindt::F_TYPE || kind == kindt::F_TYPE_NON_PTR ||
99-
kind == kindt::F_ALL)
97+
kind == symbol_kindt::F_TYPE || kind == symbol_kindt::F_TYPE_NON_PTR ||
98+
kind == symbol_kindt::F_ALL)
10099
{
101100
const irep_idt &typedef_name = src.get(ID_C_typedef);
102101
if(!typedef_name.empty() && !op(symbol_exprt{typedef_name, typet{}}))
@@ -134,8 +133,8 @@ static bool find_symbols(
134133
return false;
135134
}
136135
else if(
137-
kind == kindt::F_TYPE || kind == kindt::F_TYPE_NON_PTR ||
138-
kind == kindt::F_ALL)
136+
kind == symbol_kindt::F_TYPE || kind == symbol_kindt::F_TYPE_NON_PTR ||
137+
kind == symbol_kindt::F_ALL)
139138
{
140139
if(src.id() == ID_c_enum_tag)
141140
{
@@ -159,13 +158,13 @@ static bool find_symbols(
159158

160159
void find_symbols(const exprt &src, std::set<symbol_exprt> &dest)
161160
{
162-
find_symbols(kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
161+
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
163162
dest.insert(e);
164163
return true;
165164
});
166165
}
167166

168-
bool has_symbol(const exprt &src, const irep_idt &identifier, kindt kind)
167+
bool has_symbol(const exprt &src, const irep_idt &identifier, symbol_kindt kind)
169168
{
170169
return !find_symbols(kind, src, [&identifier](const symbol_exprt &e) {
171170
return e.get_identifier() != identifier;
@@ -174,15 +173,15 @@ bool has_symbol(const exprt &src, const irep_idt &identifier, kindt kind)
174173

175174
void find_type_symbols(const exprt &src, find_symbols_sett &dest)
176175
{
177-
find_symbols(kindt::F_TYPE, src, [&dest](const symbol_exprt &e) {
176+
find_symbols(symbol_kindt::F_TYPE, src, [&dest](const symbol_exprt &e) {
178177
dest.insert(e.get_identifier());
179178
return true;
180179
});
181180
}
182181

183182
void find_type_symbols(const typet &src, find_symbols_sett &dest)
184183
{
185-
find_symbols(kindt::F_TYPE, src, [&dest](const symbol_exprt &e) {
184+
find_symbols(symbol_kindt::F_TYPE, src, [&dest](const symbol_exprt &e) {
186185
dest.insert(e.get_identifier());
187186
return true;
188187
});
@@ -192,49 +191,51 @@ void find_non_pointer_type_symbols(
192191
const exprt &src,
193192
find_symbols_sett &dest)
194193
{
195-
find_symbols(kindt::F_TYPE_NON_PTR, src, [&dest](const symbol_exprt &e) {
196-
dest.insert(e.get_identifier());
197-
return true;
198-
});
194+
find_symbols(
195+
symbol_kindt::F_TYPE_NON_PTR, src, [&dest](const symbol_exprt &e) {
196+
dest.insert(e.get_identifier());
197+
return true;
198+
});
199199
}
200200

201201
void find_non_pointer_type_symbols(
202202
const typet &src,
203203
find_symbols_sett &dest)
204204
{
205-
find_symbols(kindt::F_TYPE_NON_PTR, src, [&dest](const symbol_exprt &e) {
206-
dest.insert(e.get_identifier());
207-
return true;
208-
});
205+
find_symbols(
206+
symbol_kindt::F_TYPE_NON_PTR, src, [&dest](const symbol_exprt &e) {
207+
dest.insert(e.get_identifier());
208+
return true;
209+
});
209210
}
210211

211212
void find_type_and_expr_symbols(const exprt &src, find_symbols_sett &dest)
212213
{
213-
find_symbols(kindt::F_ALL, src, [&dest](const symbol_exprt &e) {
214+
find_symbols(symbol_kindt::F_ALL, src, [&dest](const symbol_exprt &e) {
214215
dest.insert(e.get_identifier());
215216
return true;
216217
});
217218
}
218219

219220
void find_type_and_expr_symbols(const typet &src, find_symbols_sett &dest)
220221
{
221-
find_symbols(kindt::F_ALL, src, [&dest](const symbol_exprt &e) {
222+
find_symbols(symbol_kindt::F_ALL, src, [&dest](const symbol_exprt &e) {
222223
dest.insert(e.get_identifier());
223224
return true;
224225
});
225226
}
226227

227228
void find_symbols_or_nexts(const exprt &src, find_symbols_sett &dest)
228229
{
229-
find_symbols(kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
230+
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
230231
dest.insert(e.get_identifier());
231232
return true;
232233
});
233234
}
234235

235236
void find_symbols(const exprt &src, find_symbols_sett &dest)
236237
{
237-
find_symbols(kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
238+
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
238239
dest.insert(e.get_identifier());
239240
return true;
240241
});

src/util/find_symbols.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class typet;
2424
typedef std::unordered_set<irep_idt> find_symbols_sett;
2525

2626
/// Kinds of symbols to be considered by \ref has_symbol or \ref find_symbols.
27-
enum class kindt
27+
enum class symbol_kindt
2828
{
2929
/// Struct, union, or enum tag symbols.
3030
F_TYPE,
@@ -39,7 +39,10 @@ enum class kindt
3939

4040
/// Returns true if one of the symbols in \p src with identifier \p identifier
4141
/// is of kind \p kind.
42-
bool has_symbol(const exprt &src, const irep_idt &identifier, kindt kind);
42+
bool has_symbol(
43+
const exprt &src,
44+
const irep_idt &identifier,
45+
symbol_kindt kind);
4346

4447
DEPRECATED(SINCE(2022, 3, 14, "use find_symbols"))
4548
/// Add to the set \p dest the sub-expressions of \p src with id ID_symbol or

0 commit comments

Comments
 (0)