Add PostDominatorTree::getDescendants.
authorDiego Novillo <dnovillo@google.com>
Tue, 26 Nov 2013 20:11:12 +0000 (20:11 +0000)
committerDiego Novillo <dnovillo@google.com>
Tue, 26 Nov 2013 20:11:12 +0000 (20:11 +0000)
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
include/llvm/Analysis/PostDominators.h

index 3aa0beb6bb1eb08fa2aad4bfd6286fa71907b3cc..e35e101de3925bdd6662b4987d939c05b3b94a05 100644 (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);
index 88ebab4edecfb845be0ad1f7a44b48dc0bfb3bd4..c99ecb38c5d4878c0ddf798f54be2aab02125918 100644 (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();
   }