@@ -298,8 +298,7 @@ bool constant_propagator_domaint::valuest::is_constant(const exprt &expr) const
298298 return false ;
299299
300300 if (expr.id ()==ID_symbol)
301- if (replace_const.expr_map .find (to_symbol_expr (expr).get_identifier ())==
302- replace_const.expr_map .end ())
301+ if (!replace_const.replaces_symbol (to_symbol_expr (expr).get_identifier ()))
303302 return false ;
304303
305304 if (expr.id ()==ID_index)
@@ -337,8 +336,7 @@ bool constant_propagator_domaint::valuest::is_constant_address_of(
337336// / Do not call this when iterating over replace_const.expr_map!
338337bool constant_propagator_domaint::valuest::set_to_top (const irep_idt &id)
339338{
340- replace_symbolt::expr_mapt::size_type n_erased=
341- replace_const.expr_map .erase (id);
339+ const auto n_erased = replace_const.erase (id);
342340
343341 INVARIANT (n_erased==0 || !is_bottom, " bottom should have no elements at all" );
344342
@@ -351,7 +349,7 @@ void constant_propagator_domaint::valuest::set_dirty_to_top(
351349 const namespacet &ns)
352350{
353351 typedef replace_symbolt::expr_mapt expr_mapt;
354- expr_mapt &expr_map= replace_const.expr_map ;
352+ expr_mapt &expr_map = replace_const.get_expr_map () ;
355353
356354 for (expr_mapt::iterator it=expr_map.begin ();
357355 it!=expr_map.end ();)
@@ -377,19 +375,19 @@ void constant_propagator_domaint::valuest::output(
377375 if (is_bottom)
378376 {
379377 out << " bottom\n " ;
380- DATA_INVARIANT (replace_const. expr_map . empty (),
378+ DATA_INVARIANT (is_empty (),
381379 " If the domain is bottom, the map must be empty" );
382380 return ;
383381 }
384382
385383 INVARIANT (!is_bottom, " Have handled bottom" );
386- if (replace_const. expr_map . empty ())
384+ if (is_empty ())
387385 {
388386 out << " top\n " ;
389387 return ;
390388 }
391389
392- for (const auto &p : replace_const.expr_map )
390+ for (const auto &p : replace_const.get_expr_map () )
393391 {
394392 out << ' ' << p.first << " =" << from_expr (ns, p.first , p.second ) << ' \n ' ;
395393 }
@@ -424,20 +422,21 @@ bool constant_propagator_domaint::valuest::merge(const valuest &src)
424422
425423 bool changed=false ;
426424
427- replace_symbolt::expr_mapt &expr_map=replace_const.expr_map ;
428- const replace_symbolt::expr_mapt &src_expr_map=src.replace_const .expr_map ;
429-
430425 // handle top
431- if (src_expr_map. empty ())
426+ if (src. is_empty ())
432427 {
433428 // change if it was not top
434- changed=!expr_map. empty ();
429+ changed = ! is_empty ();
435430
436431 set_to_top ();
437432
438433 return changed;
439434 }
440435
436+ replace_symbolt::expr_mapt &expr_map = replace_const.get_expr_map ();
437+ const replace_symbolt::expr_mapt &src_expr_map =
438+ src.replace_const .get_expr_map ();
439+
441440 // remove those that are
442441 // - different in src
443442 // - do not exist in src
@@ -484,12 +483,12 @@ bool constant_propagator_domaint::valuest::meet(
484483
485484 bool changed=false ;
486485
487- for (const auto &m : src.replace_const .expr_map )
486+ for (const auto &m : src.replace_const .get_expr_map () )
488487 {
489- replace_symbolt::expr_mapt::iterator
490- c_it= replace_const.expr_map .find (m.first );
488+ replace_symbolt::expr_mapt::const_iterator c_it =
489+ replace_const.get_expr_map () .find (m.first );
491490
492- if (c_it!= replace_const.expr_map .end ())
491+ if (c_it != replace_const.get_expr_map () .end ())
493492 {
494493 if (c_it->second !=m.second )
495494 {
0 commit comments