|
25 | 25 |
|
26 | 26 | #include <analyses/dirty.h>
|
27 | 27 |
|
28 |
| -static void get_l1_name(exprt &expr); |
| 28 | +static level1t<exprt> get_l1_name(exprt expr); |
29 | 29 |
|
30 | 30 | static void set_l2_indices(
|
31 | 31 | const symex_level1t &level1,
|
@@ -222,18 +222,19 @@ void goto_symex_statet::assignment(
|
222 | 222 |
|
223 | 223 | {
|
224 | 224 | // update value sets
|
225 |
| - exprt l1_rhs(rhs); |
226 |
| - get_l1_name(l1_rhs); |
| 225 | + level1t<exprt> l1_rhs = get_l1_name(rhs); |
227 | 226 | level1t<ssa_exprt> l1_lhs = remove_level2(lhs);
|
228 | 227 |
|
229 | 228 | if(run_validation_checks)
|
230 | 229 | {
|
231 | 230 | DATA_INVARIANT(
|
232 | 231 | !check_renaming_l1(l1_lhs.expr), "lhs renaming failed on l1");
|
233 |
| - DATA_INVARIANT(!check_renaming_l1(l1_rhs), "rhs renaming failed on l1"); |
| 232 | + DATA_INVARIANT( |
| 233 | + !check_renaming_l1(l1_rhs.expr), "rhs renaming failed on l1"); |
234 | 234 | }
|
235 | 235 |
|
236 |
| - value_set.assign(l1_lhs.expr, l1_rhs, ns, rhs_is_simplified, is_shared); |
| 236 | + value_set.assign( |
| 237 | + l1_lhs.expr, l1_rhs.expr, ns, rhs_is_simplified, is_shared); |
237 | 238 | }
|
238 | 239 |
|
239 | 240 | #if 0
|
@@ -876,16 +877,14 @@ void goto_symex_statet::get_original_name(typet &type) const
|
876 | 877 | }
|
877 | 878 | }
|
878 | 879 |
|
879 |
| -static void get_l1_name(exprt &expr) |
| 880 | +static level1t<exprt> get_l1_name(exprt expr) |
880 | 881 | {
|
881 | 882 | // do not reset the type !
|
882 |
| - |
883 |
| - if(expr.id()==ID_symbol && |
884 |
| - expr.get_bool(ID_C_SSA_symbol)) |
885 |
| - to_ssa_expr(expr).remove_level_2(); |
886 |
| - else |
887 |
| - Forall_operands(it, expr) |
888 |
| - get_l1_name(*it); |
| 883 | + if(auto ssa = expr_try_dynamic_cast<ssa_exprt>(expr)) |
| 884 | + return level1t<exprt>{remove_level2(std::move(*ssa)).expr}; |
| 885 | + Forall_operands(it, expr) |
| 886 | + *it = get_l1_name(std::move(*it)).expr; |
| 887 | + return level1t<exprt>{expr}; |
889 | 888 | }
|
890 | 889 |
|
891 | 890 | /// Dumps the current state of symex, printing the function name and location
|
|
0 commit comments