Add df_iterator::getPathLength and getPath as a way of getting a path from the

entry node to the current node.

llvm-svn: 111392
This commit is contained in:
Jakob Stoklund Olesen 2010-08-18 19:00:05 +00:00
parent 5e2f7b89e9
commit 2ba69d2313
1 changed files with 10 additions and 0 deletions

View File

@ -183,6 +183,16 @@ public:
inline bool nodeVisited(NodeType *Node) const {
return this->Visited.count(Node) != 0;
}
/// getPathLength - Return the length of the path from the entry node to the
/// current node, counting both nodes.
unsigned getPathLength() const { return VisitStack.size(); }
/// getPath - Return the n'th node in the path from the the entry node to the
/// current node.
NodeType *getPath(unsigned n) const {
return VisitStack[n].first.getPointer();
}
};