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 | be21eab7ac6d66d763bedc3a5955d1eaadd5f62d (patch) | |
tree | b2487cb2441e734a86ba4ec2a65fa15349e49b18 /lib/IR/BasicBlock.cpp | |
parent | 4752eae71b9d816713cd45c19319fa4bd21bde2c (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/BasicBlock.cpp')
-rw-r--r-- | lib/IR/BasicBlock.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/IR/BasicBlock.cpp b/lib/IR/BasicBlock.cpp index b5671a66f04..76bf176498d 100644 --- a/lib/IR/BasicBlock.cpp +++ b/lib/IR/BasicBlock.cpp @@ -404,8 +404,7 @@ void BasicBlock::replaceSuccessorsPhiUsesWith(BasicBlock *New) { // Cope with being called on a BasicBlock that doesn't have a terminator // yet. Clang's CodeGenFunction::EmitReturnBlock() likes to do this. return; - for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) { - BasicBlock *Succ = TI->getSuccessor(i); + for (BasicBlock *Succ : TI->successors()) { // N.B. Succ might not be a complete BasicBlock, so don't assume // that it ends with a non-phi instruction. for (iterator II = Succ->begin(), IE = Succ->end(); II != IE; ++II) { |