summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IteratedDominanceFrontier.cpp
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-02-09 20:37:24 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-02-09 20:37:24 +0000
commit58a6e5739441b811d620d42540d2cb6cda38296e (patch)
treed1269f8d3c3a432bcd8a93eb8ea62eaa1380e538 /llvm/lib/Analysis/IteratedDominanceFrontier.cpp
parent864bd176a60d010f9252976dea19a3166a1fa7db (diff)
downloadbcm5719-llvm-58a6e5739441b811d620d42540d2cb6cda38296e.tar.gz
bcm5719-llvm-58a6e5739441b811d620d42540d2cb6cda38296e.zip
GraphTraits: Add range versions of graph traits functions (graph_nodes, graph_children, inverse_graph_nodes, inverse_graph_children).
Summary: Convert all obvious node_begin/node_end and child_begin/child_end pairs to range based for. Sending for review in case someone has a good idea how to make graph_children able to be inferred. It looks like it would require changing GraphTraits to be two argument or something. I presume inference does not happen because it would have to check every GraphTraits in the world to see if the noderef types matched. Note: This change was 3-staged with clang as well, which uses Dominators/etc from LLVM. Reviewers: chandlerc, tstellarAMD, dblaikie, rsmith Subscribers: arsenm, llvm-commits, nhaehnle Differential Revision: https://reviews.llvm.org/D29767 llvm-svn: 294620
Diffstat (limited to 'llvm/lib/Analysis/IteratedDominanceFrontier.cpp')
-rw-r--r--llvm/lib/Analysis/IteratedDominanceFrontier.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IteratedDominanceFrontier.cpp b/llvm/lib/Analysis/IteratedDominanceFrontier.cpp
index d1374acd963..27249664bce 100644
--- a/llvm/lib/Analysis/IteratedDominanceFrontier.cpp
+++ b/llvm/lib/Analysis/IteratedDominanceFrontier.cpp
@@ -64,10 +64,7 @@ void IDFCalculator<NodeTy>::calculate(
BasicBlock *BB = Node->getBlock();
// Succ is the successor in the direction we are calculating IDF, so it is
// successor for IDF, and predecessor for Reverse IDF.
- for (auto SuccIter = GraphTraits<NodeTy>::child_begin(BB),
- End = GraphTraits<NodeTy>::child_end(BB);
- SuccIter != End; ++SuccIter) {
- BasicBlock *Succ = *SuccIter;
+ for (auto *Succ : graph_children<NodeTy>(BB)) {
DomTreeNode *SuccNode = DT.getNode(Succ);
// Quickly skip all CFG edges that are also dominator tree edges instead
OpenPOWER on IntegriCloud