diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-08-06 20:22:46 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-08-06 20:22:46 +0000 |
commit | ebcd748927d45be39b2690acab7038a003bdb17f (patch) | |
tree | 756d58fbf5490c49cb38afdea5767454c1cb548a /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | b9583d22eb8dee3b7d6a299ffb54959d77ad52b4 (diff) | |
download | llvm-ebcd748927d45be39b2690acab7038a003bdb17f.zip llvm-ebcd748927d45be39b2690acab7038a003bdb17f.tar.gz llvm-ebcd748927d45be39b2690acab7038a003bdb17f.tar.bz2 |
Convert a bunch of loops to foreach. NFC.
After r244074, we now have a successors() method to iterate over
all the successors of a TerminatorInst. This commit changes a bunch
of eligible loops to use it.
llvm-svn: 244260
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 8a0bd60..874604d 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -2565,8 +2565,7 @@ static bool SimplifyTerminatorOnSelect(TerminatorInst *OldTerm, Value *Cond, BasicBlock *KeepEdge2 = TrueBB != FalseBB ? FalseBB : nullptr; // Then remove the rest. - for (unsigned I = 0, E = OldTerm->getNumSuccessors(); I != E; ++I) { - BasicBlock *Succ = OldTerm->getSuccessor(I); + for (BasicBlock *Succ : OldTerm->successors()) { // Make sure only to keep exactly one copy of each edge. if (Succ == KeepEdge1) KeepEdge1 = nullptr; |