Skip to content

Commit dd3dcc1

Browse files
Remove definition of propagationt
This was just a wrapper around a map, which was making access to the map heavier without any benefit.
1 parent 91f7830 commit dd3dcc1

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

src/goto-symex/goto_symex_state.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ void goto_symex_statet::assignment(
227227
// for value propagation -- the RHS is L2
228228

229229
if(!is_shared && record_value && goto_symex_is_constantt()(rhs))
230-
propagation.values[l1_identifier]=rhs;
230+
propagation[l1_identifier] = rhs;
231231
else
232-
propagation.remove(l1_identifier);
232+
propagation.erase(l1_identifier);
233233

234234
{
235235
// update value sets
@@ -322,10 +322,9 @@ void goto_symex_statet::rename(
322322
{
323323
// We also consider propagation if we go up to L2.
324324
// L1 identifiers are used for propagation!
325-
propagationt::valuest::const_iterator p_it=
326-
propagation.values.find(ssa.get_identifier());
325+
auto p_it = propagation.find(ssa.get_identifier());
327326

328-
if(p_it!=propagation.values.end())
327+
if(p_it != propagation.end())
329328
expr=p_it->second; // already L2
330329
else
331330
set_ssa_indices(ssa, ns, L2);

src/goto-symex/goto_symex_state.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,8 @@ class goto_symex_statet final
6565
symex_level1t level1;
6666
symex_level2t level2;
6767

68-
// this maps L1 names to (L2) constants
69-
class propagationt
70-
{
71-
public:
72-
typedef std::map<irep_idt, exprt> valuest;
73-
valuest values;
74-
void remove(const irep_idt &identifier)
75-
{
76-
values.erase(identifier);
77-
}
78-
} propagation;
68+
// Map L1 names to (L2) constants
69+
std::map<irep_idt, exprt> propagation;
7970

8071
enum levelt { L0=0, L1=1, L2=2 };
8172

@@ -124,7 +115,7 @@ class goto_symex_statet final
124115
value_sett value_set;
125116
guardt guard;
126117
symex_targett::sourcet source;
127-
propagationt propagation;
118+
std::map<irep_idt, exprt> propagation;
128119
unsigned atomic_section_id;
129120
std::unordered_map<irep_idt, local_safe_pointerst> safe_pointers;
130121
unsigned total_vccs, remaining_vccs;

src/goto-symex/symex_dead.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void goto_symext::symex_dead(statet &state)
4949
const irep_idt &l1_identifier=ssa_lhs.get_identifier();
5050

5151
// prevent propagation
52-
state.propagation.remove(l1_identifier);
52+
state.propagation.erase(l1_identifier);
5353

5454
// L2 renaming
5555
if(state.level2.current_names.find(l1_identifier)!=

src/goto-symex/symex_decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void goto_symext::symex_decl(statet &state, const symbol_exprt &expr)
6363
}
6464

6565
// prevent propagation
66-
state.propagation.remove(l1_identifier);
66+
state.propagation.erase(l1_identifier);
6767

6868
// L2 renaming
6969
// inlining may yield multiple declarations of the same identifier

src/goto-symex/symex_goto.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,21 +413,19 @@ void goto_symext::phi_function(
413413
exprt goto_state_rhs=*it, dest_state_rhs=*it;
414414

415415
{
416-
goto_symex_statet::propagationt::valuest::const_iterator p_it=
417-
goto_state.propagation.values.find(l1_identifier);
416+
const auto p_it = goto_state.propagation.find(l1_identifier);
418417

419-
if(p_it!=goto_state.propagation.values.end())
418+
if(p_it != goto_state.propagation.end())
420419
goto_state_rhs=p_it->second;
421420
else
422421
to_ssa_expr(goto_state_rhs).set_level_2(
423422
goto_state.level2_current_count(l1_identifier));
424423
}
425424

426425
{
427-
goto_symex_statet::propagationt::valuest::const_iterator p_it=
428-
dest_state.propagation.values.find(l1_identifier);
426+
const auto p_it = dest_state.propagation.find(l1_identifier);
429427

430-
if(p_it!=dest_state.propagation.values.end())
428+
if(p_it != dest_state.propagation.end())
431429
dest_state_rhs=p_it->second;
432430
else
433431
to_ssa_expr(dest_state_rhs).set_level_2(

0 commit comments

Comments
 (0)