[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h
Chris Lattner
lattner at cs.uiuc.edu
Thu Mar 20 15:22:01 PST 2003
Changes in directory llvm/include/llvm/Analysis:
Dominators.h updated: 1.31 -> 1.32
---
Log message:
Add more graph traits specializations for dominator tree nodes
---
Diffs of the changes:
Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.31 llvm/include/llvm/Analysis/Dominators.h:1.32
--- llvm/include/llvm/Analysis/Dominators.h:1.31 Thu Feb 27 14:24:17 2003
+++ llvm/include/llvm/Analysis/Dominators.h Thu Mar 20 15:21:05 2003
@@ -347,18 +347,25 @@
// 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();
}
static inline ChildIteratorType child_end(NodeType* N) {
return N->end();
+ }
+};
+
+template <> struct GraphTraits<DominatorTree*>
+ : public GraphTraits<DominatorTree::Node*> {
+ static NodeType *getEntryNode(DominatorTree *DT) {
+ return DT->getNode(DT->getRoot());
}
};
More information about the llvm-commits
mailing list