@@ -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 );
@@ -486,9 +486,9 @@ bool abstract_environmentt::merge(const abstract_environmentt &env)
486
486
// For each element in the intersection of map and env.map merge
487
487
// If the result of the merge is top, remove from the map
488
488
bool modified=false ;
489
- for (const auto &entry : env.map )
489
+ for (const auto &entry : env.map . get_view () )
490
490
{
491
- if (map.find (entry.first )!=map. end ( ))
491
+ if (map.has_key (entry.first ))
492
492
{
493
493
bool object_modified=false ;
494
494
abstract_object_pointert new_object=
@@ -629,10 +629,10 @@ void abstract_environmentt::output(
629
629
{
630
630
out << " {\n " ;
631
631
632
- for (const auto &entry : map)
632
+ for (const auto &entry : map. get_view () )
633
633
{
634
634
out << entry.first .get_identifier ()
635
- << " (" << " ) -> " ;
635
+ << " () -> " ;
636
636
entry.second ->output (out, ai, ns);
637
637
out << " \n " ;
638
638
}
@@ -653,9 +653,9 @@ Function: abstract_environmentt::verify
653
653
654
654
bool abstract_environmentt::verify () const
655
655
{
656
- for (const auto &entry : map)
656
+ for (const auto &entry : map. get_view () )
657
657
{
658
- if (! entry.second )
658
+ if (entry.second == nullptr )
659
659
{
660
660
return false ;
661
661
}
@@ -715,21 +715,21 @@ std::vector<symbol_exprt> abstract_environmentt::modified_symbols(
715
715
{
716
716
// Find all symbols who have different write locations in each map
717
717
std::vector<symbol_exprt> symbols_diff;
718
- for (const auto &entry : first.map )
718
+ for (const auto &entry : first.map . get_view () )
719
719
{
720
- const auto & second_entry = second.map .find (entry.first );
721
- if (second_entry != second. map . end () )
720
+ const auto second_entry = second.map .const_find (entry.first );
721
+ if (second_entry. second )
722
722
{
723
- if (second_entry-> second ->has_been_modified (entry.second ))
723
+ if (second_entry. first ->has_been_modified (entry.second ))
724
724
symbols_diff.push_back (entry.first );
725
725
}
726
726
}
727
727
728
728
// Add any symbols that are only in the second map
729
- for (const auto &entry : second.map )
729
+ for (const auto &entry : second.map . get_view () )
730
730
{
731
- const auto &second_entry = first.map .find (entry.first );
732
- if (second_entry==first. map . end () )
731
+ const auto &second_entry = first.map .const_find (entry.first );
732
+ if (! second_entry. second )
733
733
{
734
734
symbols_diff.push_back (entry.first );
735
735
}
0 commit comments