@@ -226,7 +226,6 @@ class goto_check_ct
226
226
void conversion_check (const exprt &, const guardt &);
227
227
void float_overflow_check (const exprt &, const guardt &);
228
228
void nan_check (const exprt &, const guardt &);
229
- optionalt<exprt> expand_pointer_checks (exprt);
230
229
231
230
std::string array_name (const exprt &);
232
231
@@ -1994,62 +1993,6 @@ void goto_check_ct::check(const exprt &expr)
1994
1993
check_rec (expr, identity);
1995
1994
}
1996
1995
1997
- // / expand the r_ok, w_ok, rw_ok, pointer_in_range predicates
1998
- optionalt<exprt> goto_check_ct::expand_pointer_checks (exprt expr)
1999
- {
2000
- bool modified = false ;
2001
-
2002
- for (auto &op : expr.operands ())
2003
- {
2004
- auto op_result = expand_pointer_checks (op);
2005
- if (op_result.has_value ())
2006
- {
2007
- op = *op_result;
2008
- modified = true ;
2009
- }
2010
- }
2011
-
2012
- if (expr.id () == ID_r_ok || expr.id () == ID_w_ok || expr.id () == ID_rw_ok)
2013
- {
2014
- // these get an address as first argument and a size as second
2015
- DATA_INVARIANT (
2016
- expr.operands ().size () == 4 , " r/w_ok must have four operands" );
2017
-
2018
- const auto conditions = get_pointer_dereferenceable_conditions (
2019
- to_r_or_w_ok_expr (expr).pointer (), to_r_or_w_ok_expr (expr).size ());
2020
-
2021
- exprt::operandst conjuncts;
2022
-
2023
- for (const auto &c : conditions)
2024
- conjuncts.push_back (c.assertion );
2025
-
2026
- exprt c = conjunction (conjuncts);
2027
- if (enable_simplify)
2028
- simplify (c, ns);
2029
- return c;
2030
- }
2031
- else if (expr.id () == ID_pointer_in_range)
2032
- {
2033
- const auto &pointer_in_range_expr = to_pointer_in_range_expr (expr);
2034
-
2035
- auto expanded = pointer_in_range_expr.lower (ns);
2036
-
2037
- // rec. call
2038
- auto expanded_rec_opt = expand_pointer_checks (expanded);
2039
- if (expanded_rec_opt.has_value ())
2040
- expanded = *expanded_rec_opt;
2041
-
2042
- if (enable_simplify)
2043
- simplify (expanded, ns);
2044
-
2045
- return expanded;
2046
- }
2047
- else if (modified)
2048
- return std::move (expr);
2049
- else
2050
- return {};
2051
- }
2052
-
2053
1996
void goto_check_ct::memory_leak_check (const irep_idt &function_id)
2054
1997
{
2055
1998
const symbolt &leak = ns.lookup (CPROVER_PREFIX " memory_leak" );
@@ -2269,8 +2212,6 @@ void goto_check_ct::goto_check(
2269
2212
}
2270
2213
}
2271
2214
2272
- i.transform ([this ](exprt expr) { return expand_pointer_checks (expr); });
2273
-
2274
2215
for (auto &instruction : new_code.instructions )
2275
2216
{
2276
2217
if (instruction.source_location ().is_nil ())
0 commit comments