Skip to content

Commit 1253dfb

Browse files
authored
Merge pull request #7155 from tautschnig/cleanup/remove-deprecated-find-symbols
Remove deprecated functions from find_symbols
2 parents 5834261 + c764c1d commit 1253dfb

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

src/util/find_symbols.cpp

+1-23
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Author: Daniel Kroening, [email protected]
1313
#include "range.h"
1414
#include "std_expr.h"
1515

16-
/// Kinds of symbols to be considered by \ref has_symbol or \ref find_symbols.
16+
/// Kinds of symbols to be considered by \ref find_symbols.
1717
enum class symbol_kindt
1818
{
1919
/// Struct, union, or enum tag symbols.
@@ -29,20 +29,6 @@ enum class symbol_kindt
2929
F_ALL
3030
};
3131

32-
bool has_symbol(const exprt &src, const find_symbols_sett &symbols)
33-
{
34-
if(src.id() == ID_symbol)
35-
return symbols.count(to_symbol_expr(src).get_identifier()) != 0;
36-
else
37-
{
38-
forall_operands(it, src)
39-
if(has_symbol(*it, symbols))
40-
return true;
41-
}
42-
43-
return false;
44-
}
45-
4632
static bool find_symbols(
4733
symbol_kindt,
4834
const typet &,
@@ -310,14 +296,6 @@ void find_type_and_expr_symbols(const typet &src, find_symbols_sett &dest)
310296
});
311297
}
312298

313-
void find_symbols_or_nexts(const exprt &src, find_symbols_sett &dest)
314-
{
315-
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
316-
dest.insert(e.get_identifier());
317-
return true;
318-
});
319-
}
320-
321299
void find_symbols(const exprt &src, find_symbols_sett &dest)
322300
{
323301
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {

src/util/find_symbols.h

-26
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_UTIL_FIND_SYMBOLS_H
1111
#define CPROVER_UTIL_FIND_SYMBOLS_H
1212

13-
#include "deprecate.h"
1413
#include "irep.h"
1514

1615
#include <algorithm>
@@ -31,29 +30,10 @@ bool has_symbol_expr(
3130
const irep_idt &identifier,
3231
bool include_bound_symbols);
3332

34-
DEPRECATED(SINCE(2022, 3, 14, "use find_symbols"))
35-
/// Add to the set \p dest the sub-expressions of \p src with id ID_symbol or
36-
/// ID_next_symbol
37-
void find_symbols_or_nexts(const exprt &src, find_symbols_sett &dest);
38-
3933
/// Add to the set \p dest the sub-expressions of \p src with id ID_symbol, for
4034
/// both free and bound variables.
4135
void find_symbols(const exprt &src, find_symbols_sett &dest);
4236

43-
/// \return set of sub-expressions of the expressions contained in the range
44-
/// defined by \p begin and \p end which have id ID_symbol or ID_next_symbol
45-
template <typename iteratort>
46-
DEPRECATED(SINCE(2022, 3, 14, "use find_symbols and a local iteration"))
47-
find_symbols_sett find_symbols_or_nexts(iteratort begin, iteratort end)
48-
{
49-
static_assert(
50-
std::is_base_of<exprt, typename iteratort::value_type>::value,
51-
"find_symbols takes exprt iterators as arguments");
52-
find_symbols_sett result;
53-
std::for_each(begin, end, [&](const exprt &e) { find_symbols(e, result); });
54-
return result;
55-
}
56-
5737
/// Find sub expressions with id ID_symbol, considering both free and bound
5838
/// variables.
5939
void find_symbols(
@@ -78,12 +58,6 @@ inline find_symbols_sett find_symbol_identifiers(const exprt &src)
7858
return identifiers;
7959
}
8060

81-
DEPRECATED(SINCE(2022, 3, 14, "use has_symbol_expr(exprt, irep_idt, bool)"))
82-
/// \return true if one of the symbols in \p src is present in \p symbols
83-
bool has_symbol(
84-
const exprt &src,
85-
const find_symbols_sett &symbols);
86-
8761
/// Collect all type tags contained in \p src and add them to \p dest.
8862
void find_type_symbols(
8963
const typet &src,

0 commit comments

Comments
 (0)