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/CloneFunction.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/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index cc4d6c6..cf11119 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -400,8 +400,8 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, // If the director says to skip with a terminate instruction, we still // need to clone this block's successors. const TerminatorInst *TI = NewBB->getTerminator(); - for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) - ToClone.push_back(TI->getSuccessor(i)); + for (const BasicBlock *Succ : TI->successors()) + ToClone.push_back(Succ); return; } assert(Action != CloningDirector::SkipInstruction && @@ -450,8 +450,8 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, // Recursively clone any reachable successor blocks. const TerminatorInst *TI = BB->getTerminator(); - for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) - ToClone.push_back(TI->getSuccessor(i)); + for (const BasicBlock *Succ : TI->successors()) + ToClone.push_back(Succ); } if (CodeInfo) { |