]> granicus.if.org Git - llvm/commitdiff
Add more graph traits specializations for dominator tree nodes
authorChris Lattner <sabre@nondot.org>
Thu, 20 Mar 2003 21:21:05 +0000 (21:21 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 20 Mar 2003 21:21:05 +0000 (21:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5751 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h

index 63a84c02cafbc7ba2b7f3ed4b636606865480f0b..7881d82125b112792bb3df9dbf37ce9d114f4db0 100644 (file)
@@ -347,12 +347,12 @@ private:
 // DominatorTree GraphTraits specialization so the DominatorTree can be
 // iterable by generic graph iterators.
 
-template <> struct GraphTraits<DominatorTree*> {
+template <> struct GraphTraits<DominatorTree::Node*> {
   typedef DominatorTree::Node NodeType;
   typedef NodeType::iterator  ChildIteratorType;
 
-  static NodeType *getEntryNode(DominatorTree *DT) {
-    return DT->getNode(DT->getRoot());
+  static NodeType *getEntryNode(NodeType *N) {
+    return N;
   }
   static inline ChildIteratorType child_begin(NodeType* N) {
     return N->begin();
@@ -362,6 +362,13 @@ template <> struct GraphTraits<DominatorTree*> {
   }
 };
 
+template <> struct GraphTraits<DominatorTree*>
+  : public GraphTraits<DominatorTree::Node*> {
+  static NodeType *getEntryNode(DominatorTree *DT) {
+    return DT->getNode(DT->getRoot());
+  }
+};
+
 //===----------------------------------------------------------------------===//
 //
 // DominanceFrontier - Calculate the dominance frontiers for a function.