Skip to content

Remove deprecated functions from find_symbols #7155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions src/util/find_symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Author: Daniel Kroening, [email protected]
#include "range.h"
#include "std_expr.h"

/// Kinds of symbols to be considered by \ref has_symbol or \ref find_symbols.
/// Kinds of symbols to be considered by \ref find_symbols.
enum class symbol_kindt
{
/// Struct, union, or enum tag symbols.
Expand All @@ -29,20 +29,6 @@ enum class symbol_kindt
F_ALL
};

bool has_symbol(const exprt &src, const find_symbols_sett &symbols)
{
if(src.id() == ID_symbol)
return symbols.count(to_symbol_expr(src).get_identifier()) != 0;
else
{
forall_operands(it, src)
if(has_symbol(*it, symbols))
return true;
}

return false;
}

static bool find_symbols(
symbol_kindt,
const typet &,
Expand Down Expand Up @@ -310,14 +296,6 @@ void find_type_and_expr_symbols(const typet &src, find_symbols_sett &dest)
});
}

void find_symbols_or_nexts(const exprt &src, find_symbols_sett &dest)
{
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
dest.insert(e.get_identifier());
return true;
});
}

void find_symbols(const exprt &src, find_symbols_sett &dest)
{
find_symbols(symbol_kindt::F_EXPR, src, [&dest](const symbol_exprt &e) {
Expand Down
26 changes: 0 additions & 26 deletions src/util/find_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_UTIL_FIND_SYMBOLS_H
#define CPROVER_UTIL_FIND_SYMBOLS_H

#include "deprecate.h"
#include "irep.h"

#include <algorithm>
Expand All @@ -31,29 +30,10 @@ bool has_symbol_expr(
const irep_idt &identifier,
bool include_bound_symbols);

DEPRECATED(SINCE(2022, 3, 14, "use find_symbols"))
/// Add to the set \p dest the sub-expressions of \p src with id ID_symbol or
/// ID_next_symbol
void find_symbols_or_nexts(const exprt &src, find_symbols_sett &dest);

/// Add to the set \p dest the sub-expressions of \p src with id ID_symbol, for
/// both free and bound variables.
void find_symbols(const exprt &src, find_symbols_sett &dest);

/// \return set of sub-expressions of the expressions contained in the range
/// defined by \p begin and \p end which have id ID_symbol or ID_next_symbol
template <typename iteratort>
DEPRECATED(SINCE(2022, 3, 14, "use find_symbols and a local iteration"))
find_symbols_sett find_symbols_or_nexts(iteratort begin, iteratort end)
{
static_assert(
std::is_base_of<exprt, typename iteratort::value_type>::value,
"find_symbols takes exprt iterators as arguments");
find_symbols_sett result;
std::for_each(begin, end, [&](const exprt &e) { find_symbols(e, result); });
return result;
}

/// Find sub expressions with id ID_symbol, considering both free and bound
/// variables.
void find_symbols(
Expand All @@ -78,12 +58,6 @@ inline find_symbols_sett find_symbol_identifiers(const exprt &src)
return identifiers;
}

DEPRECATED(SINCE(2022, 3, 14, "use has_symbol_expr(exprt, irep_idt, bool)"))
/// \return true if one of the symbols in \p src is present in \p symbols
bool has_symbol(
const exprt &src,
const find_symbols_sett &symbols);

/// Collect all type tags contained in \p src and add them to \p dest.
void find_type_symbols(
const typet &src,
Expand Down