@@ -292,8 +292,7 @@ bool constant_propagator_domaint::valuest::is_constant(const exprt &expr) const
292292 return false ;
293293
294294 if (expr.id ()==ID_symbol)
295- if (replace_const.expr_map .find (to_symbol_expr (expr).get_identifier ())==
296- replace_const.expr_map .end ())
295+ if (!replace_const.replaces_symbol (to_symbol_expr (expr).get_identifier ()))
297296 return false ;
298297
299298 if (expr.id ()==ID_index)
@@ -331,8 +330,7 @@ bool constant_propagator_domaint::valuest::is_constant_address_of(
331330// / Do not call this when iterating over replace_const.expr_map!
332331bool constant_propagator_domaint::valuest::set_to_top (const irep_idt &id)
333332{
334- replace_symbolt::expr_mapt::size_type n_erased=
335- replace_const.expr_map .erase (id);
333+ const auto n_erased = replace_const.erase (id);
336334
337335 INVARIANT (n_erased==0 || !is_bottom, " bottom should have no elements at all" );
338336
@@ -345,7 +343,7 @@ void constant_propagator_domaint::valuest::set_dirty_to_top(
345343 const namespacet &ns)
346344{
347345 typedef replace_symbolt::expr_mapt expr_mapt;
348- expr_mapt &expr_map= replace_const.expr_map ;
346+ expr_mapt &expr_map = replace_const.get_expr_map () ;
349347
350348 for (expr_mapt::iterator it=expr_map.begin ();
351349 it!=expr_map.end ();)
@@ -371,19 +369,19 @@ void constant_propagator_domaint::valuest::output(
371369 if (is_bottom)
372370 {
373371 out << " bottom\n " ;
374- DATA_INVARIANT (replace_const. expr_map . empty (),
372+ DATA_INVARIANT (is_empty (),
375373 " If the domain is bottom, the map must be empty" );
376374 return ;
377375 }
378376
379377 INVARIANT (!is_bottom, " Have handled bottom" );
380- if (replace_const. expr_map . empty ())
378+ if (is_empty ())
381379 {
382380 out << " top\n " ;
383381 return ;
384382 }
385383
386- for (const auto &p : replace_const.expr_map )
384+ for (const auto &p : replace_const.get_expr_map () )
387385 {
388386 out << ' ' << p.first << " =" << from_expr (ns, p.first , p.second ) << ' \n ' ;
389387 }
@@ -418,20 +416,21 @@ bool constant_propagator_domaint::valuest::merge(const valuest &src)
418416
419417 bool changed=false ;
420418
421- replace_symbolt::expr_mapt &expr_map=replace_const.expr_map ;
422- const replace_symbolt::expr_mapt &src_expr_map=src.replace_const .expr_map ;
423-
424419 // handle top
425- if (src_expr_map. empty ())
420+ if (src. is_empty ())
426421 {
427422 // change if it was not top
428- changed=!expr_map. empty ();
423+ changed = ! is_empty ();
429424
430425 set_to_top ();
431426
432427 return changed;
433428 }
434429
430+ replace_symbolt::expr_mapt &expr_map = replace_const.get_expr_map ();
431+ const replace_symbolt::expr_mapt &src_expr_map =
432+ src.replace_const .get_expr_map ();
433+
435434 // remove those that are
436435 // - different in src
437436 // - do not exist in src
@@ -476,12 +475,12 @@ bool constant_propagator_domaint::valuest::meet(const valuest &src)
476475
477476 bool changed=false ;
478477
479- for (const auto &m : src.replace_const .expr_map )
478+ for (const auto &m : src.replace_const .get_expr_map () )
480479 {
481- replace_symbolt::expr_mapt::iterator
482- c_it= replace_const.expr_map .find (m.first );
480+ replace_symbolt::expr_mapt::const_iterator c_it =
481+ replace_const.get_expr_map () .find (m.first );
483482
484- if (c_it!= replace_const.expr_map .end ())
483+ if (c_it != replace_const.get_expr_map () .end ())
485484 {
486485 if (c_it->second !=m.second )
487486 {
0 commit comments