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/IR/BasicBlock.cpp | |
parent | b9583d22eb8dee3b7d6a299ffb54959d77ad52b4 (diff) | |
download | bcm5719-llvm-ebcd748927d45be39b2690acab7038a003bdb17f.tar.gz bcm5719-llvm-ebcd748927d45be39b2690acab7038a003bdb17f.zip |
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/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index b5671a66f04..76bf176498d 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/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) { |