From 4e37ce82aaf13385e3113a7e7a68c0b97ef0078b Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Tue, 26 Nov 2013 20:11:12 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195778 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/Dominators.h | 4 ++-- include/llvm/Analysis/PostDominators.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 3aa0beb6bb1..e35e101de39 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -346,7 +346,7 @@ public: DomTreeNodeBase *getRootNode() { return RootNode; } const DomTreeNodeBase *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 &Result) const { const DomTreeNodeBase *RN = getNode(R); SmallVector *, 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 &Result) const { DT->getDescendants(R, Result); diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index 88ebab4edec..c99ecb38c5d 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -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 &Result) const { + DT->getDescendants(R, Result); + } + virtual void releaseMemory() { DT->releaseMemory(); }