mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
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
This commit is contained in:
@@ -347,12 +347,12 @@ private:
|
|||||||
// DominatorTree GraphTraits specialization so the DominatorTree can be
|
// DominatorTree GraphTraits specialization so the DominatorTree can be
|
||||||
// iterable by generic graph iterators.
|
// iterable by generic graph iterators.
|
||||||
|
|
||||||
template <> struct GraphTraits<DominatorTree*> {
|
template <> struct GraphTraits<DominatorTree::Node*> {
|
||||||
typedef DominatorTree::Node NodeType;
|
typedef DominatorTree::Node NodeType;
|
||||||
typedef NodeType::iterator ChildIteratorType;
|
typedef NodeType::iterator ChildIteratorType;
|
||||||
|
|
||||||
static NodeType *getEntryNode(DominatorTree *DT) {
|
static NodeType *getEntryNode(NodeType *N) {
|
||||||
return DT->getNode(DT->getRoot());
|
return N;
|
||||||
}
|
}
|
||||||
static inline ChildIteratorType child_begin(NodeType* N) {
|
static inline ChildIteratorType child_begin(NodeType* N) {
|
||||||
return N->begin();
|
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.
|
// DominanceFrontier - Calculate the dominance frontiers for a function.
|
||||||
|
Reference in New Issue
Block a user