OSDN Git Service

Drop graph_ prefix
authorDaniel Berlin <dberlin@dberlin.org>
Thu, 9 Feb 2017 20:37:46 +0000 (20:37 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Thu, 9 Feb 2017 20:37:46 +0000 (20:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294621 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/GraphTraits.h
include/llvm/Support/GenericDomTree.h
include/llvm/Support/GenericDomTreeConstruction.h
lib/Analysis/IteratedDominanceFrontier.cpp
lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
lib/Target/Hexagon/HexagonBitSimplify.cpp
lib/Target/Hexagon/HexagonCommonGEP.cpp
lib/Target/Hexagon/HexagonGenExtract.cpp
lib/Target/Hexagon/HexagonGenInsert.cpp

index bf17fac..2c88c42 100644 (file)
@@ -91,27 +91,27 @@ template <class T> struct GraphTraits<Inverse<Inverse<T>>> : GraphTraits<T> {};
 // Provide iterator ranges for the graph traits nodes and children
 template <class GraphType>
 iterator_range<typename GraphTraits<GraphType>::nodes_iterator>
-graph_nodes(const GraphType &G) {
+nodes(const GraphType &G) {
   return make_range(GraphTraits<GraphType>::nodes_begin(G),
                     GraphTraits<GraphType>::nodes_end(G));
 }
 template <class GraphType>
 iterator_range<typename GraphTraits<Inverse<GraphType>>::nodes_iterator>
-inverse_graph_nodes(const GraphType &G) {
+inverse_nodes(const GraphType &G) {
   return make_range(GraphTraits<Inverse<GraphType>>::nodes_begin(G),
                     GraphTraits<Inverse<GraphType>>::nodes_end(G));
 }
 
 template <class GraphType>
 iterator_range<typename GraphTraits<GraphType>::ChildIteratorType>
-graph_children(const typename GraphTraits<GraphType>::NodeRef &G) {
+children(const typename GraphTraits<GraphType>::NodeRef &G) {
   return make_range(GraphTraits<GraphType>::child_begin(G),
                     GraphTraits<GraphType>::child_end(G));
 }
 
 template <class GraphType>
 iterator_range<typename GraphTraits<Inverse<GraphType>>::ChildIteratorType>
-inverse_graph_children(const typename GraphTraits<GraphType>::NodeRef &G) {
+inverse_children(const typename GraphTraits<GraphType>::NodeRef &G) {
   return make_range(GraphTraits<Inverse<GraphType>>::child_begin(G),
                     GraphTraits<Inverse<GraphType>>::child_end(G));
 }
index de0a85d..8be7c7d 100644 (file)
@@ -782,7 +782,7 @@ public:
       Calculate<FT, NodeT *>(*this, F);
     } else {
       // Initialize the roots list
-      for (auto *Node : graph_nodes(&F))
+      for (auto *Node : nodes(&F))
         if (TraitsTy::child_begin(Node) == TraitsTy::child_end(Node))
           addRoot(Node);
 
index 19b2232..c1d757f 100644 (file)
@@ -200,7 +200,7 @@ void Calculate(DominatorTreeBaseByGraphTraits<GraphTraits<NodeT>> &DT,
 
     // initialize the semi dominator to point to the parent node
     WInfo.Semi = WInfo.Parent;
-    for (const auto &N : inverse_graph_children<NodeT>(W))
+    for (const auto &N : inverse_children<NodeT>(W))
       if (DT.Info.count(N)) { // Only if this predecessor is reachable!
         unsigned SemiU = DT.Info[Eval<GraphT>(DT, N, i + 1)].Semi;
         if (SemiU < WInfo.Semi)
index 2724966..2a736ec 100644 (file)
@@ -64,7 +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 *Succ : graph_children<NodeTy>(BB)) {
+      for (auto *Succ : children<NodeTy>(BB)) {
         DomTreeNode *SuccNode = DT.getNode(Succ);
 
         // Quickly skip all CFG edges that are also dominator tree edges instead
index e83faea..d150984 100644 (file)
@@ -912,7 +912,7 @@ void AMDGPUCFGStructurizer::orderBlocks(MachineFunction *MF) {
   }
 
   // walk through all the block in func to check for unreachable
-  for (auto *MBB : graph_nodes(MF)) {
+  for (auto *MBB : nodes(MF)) {
     SccNum = getSCCNum(MBB);
     if (SccNum == INVALIDSCCNUM)
       dbgs() << "unreachable block BB" << MBB->getNumber() << "\n";
@@ -1078,7 +1078,7 @@ int AMDGPUCFGStructurizer::mergeLoop(MachineLoop *LoopRep) {
   MachineBasicBlock *ExitBlk = *ExitBlks.begin();
   assert(ExitBlk && "Loop has several exit block");
   MBBVector LatchBlks;
-  for (auto *LB : inverse_graph_children<MachineBasicBlock*>(LoopHeader))
+  for (auto *LB : inverse_children<MachineBasicBlock*>(LoopHeader))
     if (LoopRep->contains(LB))
       LatchBlks.push_back(LB);
 
index 895889c..fda7f7f 100644 (file)
@@ -260,7 +260,7 @@ bool HexagonBitSimplify::visitBlock(MachineBasicBlock &B, Transformation &T,
   RegisterSet NewAVs = AVs;
   NewAVs.insert(Defs);
 
-  for (auto *DTN : graph_children<MachineDomTreeNode*>(MDT->getNode(&B)))
+  for (auto *DTN : children<MachineDomTreeNode*>(MDT->getNode(&B)))
     Changed |= visitBlock(*(DTN->getBlock()), T, NewAVs);
 
   if (!T.TopDown)
@@ -982,7 +982,7 @@ bool DeadCodeElimination::isDead(unsigned R) const {
 bool DeadCodeElimination::runOnNode(MachineDomTreeNode *N) {
   bool Changed = false;
 
-  for (auto *DTN : graph_children<MachineDomTreeNode*>(N))
+  for (auto *DTN : children<MachineDomTreeNode*>(N))
     Changed |= runOnNode(DTN);
 
   MachineBasicBlock *B = N->getBlock();
index d3174b2..a07ba77 100644 (file)
@@ -315,7 +315,7 @@ void HexagonCommonGEP::getBlockTraversalOrder(BasicBlock *Root,
   // visited".
 
   Order.push_back(Root);
-  for (auto *DTN : graph_children<DomTreeNode*>(DT->getNode(Root)))
+  for (auto *DTN : children<DomTreeNode*>(DT->getNode(Root)))
     getBlockTraversalOrder(DTN->getBlock(), Order);
 }
 
@@ -1232,7 +1232,7 @@ void HexagonCommonGEP::removeDeadCode() {
 
   for (unsigned i = 0; i < BO.size(); ++i) {
     BasicBlock *B = cast<BasicBlock>(BO[i]);
-    for (auto DTN : graph_children<DomTreeNode*>(DT->getNode(B)))
+    for (auto DTN : children<DomTreeNode*>(DT->getNode(B)))
       BO.push_back(DTN->getBlock());
   }
 
index 7fd52c9..f6f3a59 100644 (file)
@@ -221,7 +221,7 @@ bool HexagonGenExtract::convert(Instruction *In) {
 
 bool HexagonGenExtract::visitBlock(BasicBlock *B) {
   // Depth-first, bottom-up traversal.
-  for (auto *DTN : graph_children<DomTreeNode*>(DT->getNode(B)))
+  for (auto *DTN : children<DomTreeNode*>(DT->getNode(B)))
     visitBlock(DTN->getBlock());
 
   // Allow limiting the number of generated extracts for debugging purposes.
index 60b4fe6..54d99d3 100644 (file)
@@ -947,7 +947,7 @@ void HexagonGenInsert::collectInBlock(MachineBasicBlock *B,
     BlockDefs.insert(InsDefs);
   }
 
-  for (auto *DTN : graph_children<MachineDomTreeNode*>(MDT->getNode(B))) {
+  for (auto *DTN : children<MachineDomTreeNode*>(MDT->getNode(B))) {
     MachineBasicBlock *SB = DTN->getBlock();
     collectInBlock(SB, AVs);
   }
@@ -1420,7 +1420,7 @@ bool HexagonGenInsert::generateInserts() {
 bool HexagonGenInsert::removeDeadCode(MachineDomTreeNode *N) {
   bool Changed = false;
 
-  for (auto *DTN : graph_children<MachineDomTreeNode*>(N))
+  for (auto *DTN : children<MachineDomTreeNode*>(N))
     Changed |= removeDeadCode(DTN);
 
   MachineBasicBlock *B = N->getBlock();