From d11beffef4f1117aceb9f2f5532b4a317c30c05a Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Sun, 20 Jul 2014 09:10:11 +0000 Subject: [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 --- llvm/lib/IR/Dominators.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/IR/Dominators.cpp') diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index d6649d6c706..f45543a4e71 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -179,9 +179,7 @@ bool DominatorTree::dominates(const BasicBlockEdge &BBE, // trivially dominates itself, so we only have to find if it dominates the // other predecessors. Since the only way out of X is via NormalDest, X can // only properly dominate a node if NormalDest dominates that node too. - for (const_pred_iterator PI = pred_begin(End), E = pred_end(End); - PI != E; ++PI) { - const BasicBlock *BB = *PI; + for (const BasicBlock *BB : predecessors(End)) { if (BB == Start) continue; -- cgit v1.2.3