aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/Dominators.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 63a84c02ca..7881d82125 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<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.