summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-08-06 20:22:46 +0000
committerPete Cooper <peter_cooper@apple.com>2015-08-06 20:22:46 +0000
commitebcd748927d45be39b2690acab7038a003bdb17f (patch)
tree756d58fbf5490c49cb38afdea5767454c1cb548a /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parentb9583d22eb8dee3b7d6a299ffb54959d77ad52b4 (diff)
downloadbcm5719-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/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 1bf92e35abc..d59eef37da6 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -41,8 +41,8 @@ void llvm::DeleteDeadBlock(BasicBlock *BB) {
// Loop through all of our successors and make sure they know that one
// of their predecessors is going away.
- for (unsigned i = 0, e = BBTerm->getNumSuccessors(); i != e; ++i)
- BBTerm->getSuccessor(i)->removePredecessor(BB);
+ for (BasicBlock *Succ : BBTerm->successors())
+ Succ->removePredecessor(BB);
// Zap all the instructions in the block.
while (!BB->empty()) {
OpenPOWER on IntegriCloud