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/IR/BasicBlock.cpp | |
parent | 4100ebd67b61abfb7fc7728e9af5dcc6e51327be (diff) | |
download | llvm-d11beffef4f1117aceb9f2f5532b4a317c30c05a.zip llvm-d11beffef4f1117aceb9f2f5532b4a317c30c05a.tar.gz llvm-d11beffef4f1117aceb9f2f5532b4a317c30c05a.tar.bz2 |
[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/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 ba07433..8ddcf25 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -321,10 +321,9 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) { // successors. If there were PHI nodes in the successors, then they need to // know that incoming branches will be from New, not from Old. // - for (succ_iterator I = succ_begin(New), E = succ_end(New); I != E; ++I) { + for (BasicBlock *Successor : successors(New)) { // Loop over any phi nodes in the basic block, updating the BB field of // incoming values... - BasicBlock *Successor = *I; PHINode *PN; for (BasicBlock::iterator II = Successor->begin(); (PN = dyn_cast<PHINode>(II)); ++II) { |