|
20 | 20 | #include <util/c_types.h>
|
21 | 21 | #include <util/exception_utils.h>
|
22 | 22 | #include <util/expr_util.h>
|
23 |
| -#include <util/find_symbols.h> |
24 | 23 | #include <util/invariant.h>
|
25 | 24 | #include <util/std_expr.h>
|
26 | 25 |
|
@@ -837,13 +836,15 @@ ssa_exprt goto_symex_statet::declare(ssa_exprt ssa, const namespacet &ns)
|
837 | 836 |
|
838 | 837 | // L2 renaming
|
839 | 838 | const exprt fields = field_sensitivity.get_fields(ns, *this, ssa);
|
840 |
| - for(const auto &l1_symbol : find_symbols(fields)) |
841 |
| - { |
842 |
| - const ssa_exprt &field_ssa = to_ssa_expr(l1_symbol); |
843 |
| - const std::size_t field_generation = level2.increase_generation( |
844 |
| - l1_symbol.get_identifier(), field_ssa, fresh_l2_name_provider); |
845 |
| - CHECK_RETURN(field_generation == 1); |
846 |
| - } |
| 839 | + fields.visit_pre([this](const exprt &e) { |
| 840 | + if(auto l1_symbol = expr_try_dynamic_cast<symbol_exprt>(e)) |
| 841 | + { |
| 842 | + const ssa_exprt &field_ssa = to_ssa_expr(*l1_symbol); |
| 843 | + const std::size_t field_generation = level2.increase_generation( |
| 844 | + l1_symbol->get_identifier(), field_ssa, fresh_l2_name_provider); |
| 845 | + CHECK_RETURN(field_generation == 1); |
| 846 | + } |
| 847 | + }); |
847 | 848 |
|
848 | 849 | record_events.push(false);
|
849 | 850 | exprt expr_l2 = rename(std::move(ssa), ns).get();
|
|
0 commit comments