6
6
7
7
\*******************************************************************/
8
8
9
- #ifndef CPROVER_ANALYSES_CFG_DOMINATORS_H
10
- #define CPROVER_ANALYSES_CFG_DOMINATORS_H
9
+ #ifndef CPROVER_SRC_ANALYSES_CFG_DOMINATORS_H
10
+ #define CPROVER_SRC_ANALYSES_CFG_DOMINATORS_H
11
11
12
12
#include < set>
13
13
#include < list>
@@ -144,13 +144,15 @@ void cfg_dominators_templatet<P, T, post_dom>::fixedpoint(P &program)
144
144
bool changed=false ;
145
145
typename cfgt::nodet &node=cfg[cfg.entry_map [current]];
146
146
if (node.dominators .empty ())
147
+ {
147
148
for (const auto & edge : (post_dom?node.out :node.in ))
148
149
if (!cfg[edge.first ].dominators .empty ())
149
150
{
150
151
node.dominators =cfg[edge.first ].dominators ;
151
152
node.dominators .insert (current);
152
153
changed=true ;
153
154
}
155
+ }
154
156
155
157
// compute intersection of predecessors
156
158
for (const auto & edge : (post_dom?node.out :node.in ))
@@ -165,10 +167,14 @@ void cfg_dominators_templatet<P, T, post_dom>::fixedpoint(P &program)
165
167
// in-place intersection. not safe to use set_intersect
166
168
while (n_it!=node.dominators .end () && o_it!=other.end ())
167
169
{
168
- if (*n_it==current) ++n_it;
169
- else if (*n_it<*o_it) { changed=true ; node.dominators .erase (n_it++); }
170
- else if (*o_it<*n_it) ++o_it;
171
- else { ++n_it; ++o_it; }
170
+ if (*n_it==current)
171
+ ++n_it;
172
+ else if (*n_it<*o_it)
173
+ { changed=true ; node.dominators .erase (n_it++); }
174
+ else if (*o_it<*n_it)
175
+ ++o_it;
176
+ else
177
+ { ++n_it; ++o_it; }
172
178
}
173
179
174
180
while (n_it!=node.dominators .end ())
@@ -248,10 +254,14 @@ void cfg_dominators_templatet<P, T, post_dom>::output(std::ostream &out) const
248
254
}
249
255
}
250
256
251
- typedef cfg_dominators_templatet<const goto_programt, goto_programt::const_targett, false >
257
+ typedef cfg_dominators_templatet<const goto_programt,
258
+ goto_programt::const_targett,
259
+ false >
252
260
cfg_dominatorst;
253
261
254
- typedef cfg_dominators_templatet<const goto_programt, goto_programt::const_targett, true >
262
+ typedef cfg_dominators_templatet<const goto_programt,
263
+ goto_programt::const_targett,
264
+ true >
255
265
cfg_post_dominatorst;
256
266
257
267
template <>
0 commit comments