[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h

Devang Patel dpatel at apple.com
Thu Jun 7 15:17:38 PDT 2007



Changes in directory llvm/include/llvm/Analysis:

Dominators.h updated: 1.95 -> 1.96
---
Log message:

Do not use ETForest as well as DomiantorTree.  DominatorTree is sufficient.


---
Diffs of the changes:  (+10 -0)

 Dominators.h |   10 ++++++++++
 1 files changed, 10 insertions(+)


Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.95 llvm/include/llvm/Analysis/Dominators.h:1.96
--- llvm/include/llvm/Analysis/Dominators.h:1.95	Thu Jun  7 16:34:22 2007
+++ llvm/include/llvm/Analysis/Dominators.h	Thu Jun  7 17:17:16 2007
@@ -142,6 +142,16 @@
     return getNode(BB);
   }
 
+  /// getIDomBlock - return basic block BB's immediate domiantor basic block.
+  ///
+  BasicBlock *getIDomBlock(BasicBlock *BB) {
+    DomTreeNode *N = getNode(BB);
+    assert (N && "Missing dominator tree node");
+    DomTreeNode *I = N->getIDom();
+    assert (N && "Missing immediate dominator");
+    return I->getBlock();
+  }
+
   /// getRootNode - This returns the entry node for the CFG of the function.  If
   /// this tree represents the post-dominance relations for a function, however,
   /// this root may be a node with the block == NULL.  This is the case when






More information about the llvm-commits mailing list