[llvm] r195778 - Add PostDominatorTree::getDescendants.

Diego Novillo dnovillo at google.com
Tue Nov 26 12:11:13 PST 2013


Author: dnovillo
Date: Tue Nov 26 14:11:12 2013
New Revision: 195778

URL: http://llvm.org/viewvc/llvm-project?rev=195778&view=rev
Log:
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.

Modified:
    llvm/trunk/include/llvm/Analysis/Dominators.h
    llvm/trunk/include/llvm/Analysis/PostDominators.h

Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=195778&r1=195777&r2=195778&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Tue Nov 26 14:11:12 2013
@@ -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);

Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=195778&r1=195777&r2=195778&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/PostDominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/PostDominators.h Tue Nov 26 14:11:12 2013
@@ -79,6 +79,12 @@ struct PostDominatorTree : public Functi
     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();
   }





More information about the llvm-commits mailing list