@@ -88,8 +88,8 @@ bool reaches(const CFGBlock *Before, const CFGBlock *After) {
88
88
89
89
Visited.insert (Current);
90
90
91
- for (const auto & Succ : Current->succs ()) {
92
- if (!Visited.count (Succ))
91
+ for (const CFGBlock * Succ : Current->succs ()) {
92
+ if (Succ && !Visited.contains (Succ))
93
93
Stack.push_back (Succ);
94
94
}
95
95
}
@@ -146,10 +146,10 @@ bool UseAfterMoveFinder::find(Stmt *CodeBlock, const Expr *MovingCall,
146
146
MoveBlock = &TheCFG->getEntry ();
147
147
}
148
148
149
- bool found = findInternal (MoveBlock, MovingCall, MovedVariable->getDecl (),
149
+ bool Found = findInternal (MoveBlock, MovingCall, MovedVariable->getDecl (),
150
150
TheUseAfterMove);
151
151
152
- if (found ) {
152
+ if (Found ) {
153
153
if (const CFGBlock *UseBlock =
154
154
BlockMap->blockContainingStmt (TheUseAfterMove->DeclRef ))
155
155
// Does the use happen in a later loop iteration than the move?
@@ -158,11 +158,10 @@ bool UseAfterMoveFinder::find(Stmt *CodeBlock, const Expr *MovingCall,
158
158
// - Otherwise, we know the use happened in a later iteration if the
159
159
// move is reachable from the use.
160
160
TheUseAfterMove->UseHappensInLaterLoopIteration =
161
- UseBlock == MoveBlock ? Visited.count (UseBlock) != 0
161
+ UseBlock == MoveBlock ? Visited.contains (UseBlock)
162
162
: reaches (UseBlock, MoveBlock);
163
163
}
164
-
165
- return found;
164
+ return Found;
166
165
}
167
166
168
167
bool UseAfterMoveFinder::findInternal (const CFGBlock *Block,
0 commit comments