From e33b7968514580c8b7f0c6529ddeeb7537ecfb9b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 20 Mar 2003 21:21:05 +0000 Subject: [PATCH] Add more graph traits specializations for dominator tree nodes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5751 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/Dominators.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 63a84c02caf..7881d82125b 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -347,12 +347,12 @@ private: // DominatorTree GraphTraits specialization so the DominatorTree can be // iterable by generic graph iterators. -template <> struct GraphTraits { +template <> struct GraphTraits { 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 { } }; +template <> struct GraphTraits + : public GraphTraits { + static NodeType *getEntryNode(DominatorTree *DT) { + return DT->getNode(DT->getRoot()); + } +}; + //===----------------------------------------------------------------------===// // // DominanceFrontier - Calculate the dominance frontiers for a function. -- 2.34.1