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 | c0fb95811ad7a3a6391aaba608ea0cd867b50006 (patch) | |
tree | de24c87ea4724abbc9c69a8e283f7ca804f912e0 /lib/Analysis/IteratedDominanceFrontier.cpp | |
parent | 4c5e9062fdb06dad6d660a5abf4a96723eced198 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IteratedDominanceFrontier.cpp')
-rw-r--r-- | lib/Analysis/IteratedDominanceFrontier.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Analysis/IteratedDominanceFrontier.cpp b/lib/Analysis/IteratedDominanceFrontier.cpp index d1374acd963..27249664bce 100644 --- a/lib/Analysis/IteratedDominanceFrontier.cpp +++ b/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 |