Make succ_iterator a real random access iterator and clean up a couple of users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2014-02-10 14:17:42 +00:00
parent df3ae8e4f0
commit 299918ad48
5 changed files with 74 additions and 51 deletions
+2 -4
View File
@@ -168,8 +168,7 @@ static bool isPotentiallyReachableInner(SmallVectorImpl<BasicBlock *> &Worklist,
// ignoring any other blocks inside the loop body.
Outer->getExitBlocks(Worklist);
} else {
for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I)
Worklist.push_back(*I);
Worklist.append(succ_begin(BB), succ_end(BB));
}
} while (!Worklist.empty());
@@ -222,8 +221,7 @@ bool llvm::isPotentiallyReachable(const Instruction *A, const Instruction *B,
return false;
// Otherwise, continue doing the normal per-BB CFG walk.
for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I)
Worklist.push_back(*I);
Worklist.append(succ_begin(BB), succ_end(BB));
if (Worklist.empty()) {
// We've proven that there's no path!