@@ -52,14 +52,14 @@ abstract_object_pointert abstract_environmentt::eval(
52
52
if (simplified_id==ID_symbol)
53
53
{
54
54
const symbol_exprt &symbol (to_symbol_expr (simplified_expr));
55
- const auto &symbol_entry=map.find (symbol);
56
- if (symbol_entry==map. cend () )
55
+ const auto &symbol_entry=map.const_find (symbol);
56
+ if (! symbol_entry. second )
57
57
{
58
58
return abstract_object_factory (simplified_expr.type (), ns, true );
59
59
}
60
60
else
61
61
{
62
- abstract_object_pointert found_symbol_value=symbol_entry-> second ;
62
+ abstract_object_pointert found_symbol_value=symbol_entry. first ;
63
63
return found_symbol_value;
64
64
}
65
65
}
@@ -191,7 +191,7 @@ bool abstract_environmentt::assign(
191
191
{
192
192
INVARIANT (s.id ()==ID_symbol, " Have a symbol or a stack" );
193
193
const symbol_exprt &symbol_expr (to_symbol_expr (s));
194
- if (map.find (symbol_expr)==map. end ( ))
194
+ if (! map.has_key (symbol_expr))
195
195
{
196
196
lhs_value=abstract_object_factory (
197
197
symbol_expr.type (), ns, true , false );
@@ -483,9 +483,9 @@ bool abstract_environmentt::merge(const abstract_environmentt &env)
483
483
// For each element in the intersection of map and env.map merge
484
484
// If the result of the merge is top, remove from the map
485
485
bool modified=false ;
486
- for (const auto &entry : env.map )
486
+ for (const auto &entry : env.map . get_view () )
487
487
{
488
- if (map.find (entry.first )!=map. end ( ))
488
+ if (map.has_key (entry.first ))
489
489
{
490
490
bool object_modified=false ;
491
491
abstract_object_pointert new_object=
@@ -626,10 +626,10 @@ void abstract_environmentt::output(
626
626
{
627
627
out << " {\n " ;
628
628
629
- for (const auto &entry : map)
629
+ for (const auto &entry : map. get_view () )
630
630
{
631
631
out << entry.first .get_identifier ()
632
- << " (" << " ) -> " ;
632
+ << " () -> " ;
633
633
entry.second ->output (out, ai, ns);
634
634
out << " \n " ;
635
635
}
@@ -650,9 +650,9 @@ Function: abstract_environmentt::verify
650
650
651
651
bool abstract_environmentt::verify () const
652
652
{
653
- for (const auto &entry : map)
653
+ for (const auto &entry : map. get_view () )
654
654
{
655
- if (! entry.second )
655
+ if (entry.second == nullptr )
656
656
{
657
657
return false ;
658
658
}
@@ -712,21 +712,21 @@ std::vector<symbol_exprt> abstract_environmentt::modified_symbols(
712
712
{
713
713
// Find all symbols who have different write locations in each map
714
714
std::vector<symbol_exprt> symbols_diff;
715
- for (const auto &entry : first.map )
715
+ for (const auto &entry : first.map . get_view () )
716
716
{
717
- const auto & second_entry = second.map .find (entry.first );
718
- if (second_entry != second. map . end () )
717
+ const auto second_entry = second.map .const_find (entry.first );
718
+ if (second_entry. second )
719
719
{
720
- if (second_entry-> second ->has_been_modified (entry.second ))
720
+ if (second_entry. first ->has_been_modified (entry.second ))
721
721
symbols_diff.push_back (entry.first );
722
722
}
723
723
}
724
724
725
725
// Add any symbols that are only in the second map
726
- for (const auto &entry : second.map )
726
+ for (const auto &entry : second.map . get_view () )
727
727
{
728
- const auto &second_entry = first.map .find (entry.first );
729
- if (second_entry==first. map . end () )
728
+ const auto &second_entry = first.map .const_find (entry.first );
729
+ if (! second_entry. second )
730
730
{
731
731
symbols_diff.push_back (entry.first );
732
732
}
0 commit comments