diff options
author | Manuel Jacob <me@manueljacob.de> | 2014-07-20 09:10:11 +0000 |
---|---|---|
committer | Manuel Jacob <me@manueljacob.de> | 2014-07-20 09:10:11 +0000 |
commit | d11beffef4f1117aceb9f2f5532b4a317c30c05a (patch) | |
tree | c0a3aa5e2d4225971366e16eac335aacf32f9eed /llvm/lib/CodeGen/UnreachableBlockElim.cpp | |
parent | 4100ebd67b61abfb7fc7728e9af5dcc6e51327be (diff) | |
download | bcm5719-llvm-d11beffef4f1117aceb9f2f5532b4a317c30c05a.tar.gz bcm5719-llvm-d11beffef4f1117aceb9f2f5532b4a317c30c05a.zip |
[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges.
Summary: This patch introduces two new iterator ranges and updates existing code to use it. No functional change intended.
Test Plan: All tests (make check-all) still pass.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4481
llvm-svn: 213474
Diffstat (limited to 'llvm/lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r-- | llvm/lib/CodeGen/UnreachableBlockElim.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp index 2e220820b92..0476a1292f8 100644 --- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp +++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp @@ -79,8 +79,8 @@ bool UnreachableBlockElim::runOnFunction(Function &F) { PN->replaceAllUsesWith(Constant::getNullValue(PN->getType())); BB->getInstList().pop_front(); } - for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI) - (*SI)->removePredecessor(BB); + for (BasicBlock *S : successors(BB)) + S->removePredecessor(BB); BB->dropAllReferences(); } |