diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2017-02-09 20:37:24 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2017-02-09 20:37:24 +0000 |
commit | 58a6e5739441b811d620d42540d2cb6cda38296e (patch) | |
tree | d1269f8d3c3a432bcd8a93eb8ea62eaa1380e538 /llvm/lib/Analysis | |
parent | 864bd176a60d010f9252976dea19a3166a1fa7db (diff) | |
download | bcm5719-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')
-rw-r--r-- | llvm/lib/Analysis/IteratedDominanceFrontier.cpp | 5 |
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 |