@@ -371,35 +371,40 @@ exprt goto_symex_statet::rename_level1(exprt expr, const namespacet &ns)
371
371
return expr;
372
372
}
373
373
374
+ exprt goto_symex_statet::rename_level2_ssa (ssa_exprt ssa, const namespacet &ns)
375
+ {
376
+ set_l1_indices (ssa, ns);
377
+ rename (ssa.type (), ssa.get_identifier (), ns);
378
+ ssa.update_type ();
379
+
380
+ if (l2_thread_read_encoding (ssa, ns))
381
+ {
382
+ // renaming taken care of by l2_thread_encoding
383
+ }
384
+ else if (!ssa.get_level_2 ().empty ())
385
+ {
386
+ // already at L2
387
+ }
388
+ else
389
+ {
390
+ // We also consider propagation if we go up to L2.
391
+ // L1 identifiers are used for propagation!
392
+ auto p_it = propagation.find (ssa.get_identifier ());
393
+
394
+ if (p_it != propagation.end ())
395
+ return p_it->second ; // already L2
396
+
397
+ set_l2_indices (ssa, ns);
398
+ }
399
+ return ssa;
400
+ }
401
+
374
402
void goto_symex_statet::rename_level2 (exprt &expr, const namespacet &ns)
375
403
{
376
404
// rename all the symbols with their last known value
377
405
renaming_strategyt strategy;
378
406
strategy.rename_ssa = [this ](ssa_exprt ssa, const namespacet &ns) -> exprt {
379
- set_l1_indices (ssa, ns);
380
- rename (ssa.type (), ssa.get_identifier (), ns, L2);
381
- ssa.update_type ();
382
-
383
- if (l2_thread_read_encoding (ssa, ns))
384
- {
385
- // renaming taken care of by l2_thread_encoding
386
- }
387
- else if (!ssa.get_level_2 ().empty ())
388
- {
389
- // already at L2
390
- }
391
- else
392
- {
393
- // We also consider propagation if we go up to L2.
394
- // L1 identifiers are used for propagation!
395
- auto p_it = propagation.find (ssa.get_identifier ());
396
-
397
- if (p_it != propagation.end ())
398
- return p_it->second ; // already L2
399
-
400
- set_l2_indices (ssa, ns);
401
- }
402
- return ssa;
407
+ return rename_level2_ssa (ssa, ns);
403
408
};
404
409
strategy.rename_address =
405
410
[&](address_of_exprt &address_of_expr, const namespacet &ns) {
0 commit comments