Add PostDominatorTree::getDescendants.

This patch adds the counter-part to DominatorTree::getDescendants.
It also fixes a couple of comments I noticed out of date in the
DominatorTree class.

llvm-svn: 195778
This commit is contained in:
Diego Novillo 2013-11-26 20:11:12 +00:00
parent bbf2455d59
commit c8e93646d8
2 changed files with 8 additions and 2 deletions

View File

@ -346,7 +346,7 @@ public:
DomTreeNodeBase<NodeT> *getRootNode() { return RootNode; }
const DomTreeNodeBase<NodeT> *getRootNode() const { return RootNode; }
/// Get all nodes dominated by R, including R itself. Return true on success.
/// Get all nodes dominated by R, including R itself.
void getDescendants(NodeT *R, SmallVectorImpl<NodeT *> &Result) const {
const DomTreeNodeBase<NodeT> *RN = getNode(R);
SmallVector<const DomTreeNodeBase<NodeT> *, 8> WL;
@ -769,7 +769,7 @@ public:
return DT->getRootNode();
}
/// Get all nodes dominated by R, including R itself. Return true on success.
/// Get all nodes dominated by R, including R itself.
void getDescendants(BasicBlock *R,
SmallVectorImpl<BasicBlock *> &Result) const {
DT->getDescendants(R, Result);

View File

@ -79,6 +79,12 @@ struct PostDominatorTree : public FunctionPass {
return DT->findNearestCommonDominator(A, B);
}
/// Get all nodes post-dominated by R, including R itself.
void getDescendants(BasicBlock *R,
SmallVectorImpl<BasicBlock *> &Result) const {
DT->getDescendants(R, Result);
}
virtual void releaseMemory() {
DT->releaseMemory();
}