Don't use PassInfo* as a type identifier for passes. Instead, use the address of...
[oota-llvm.git] / include / llvm / Analysis / PostDominators.h
index ea14b2da9ce97b5761ba2165fbe4192454ec7a20..46ce8200f96632b06f239fcfd151b9eefe078934 100644 (file)
@@ -25,7 +25,7 @@ struct PostDominatorTree : public FunctionPass {
   static char ID; // Pass identification, replacement for typeid
   DominatorTreeBase<BasicBlock>* DT;
 
-  PostDominatorTree() : FunctionPass(&ID) {
+  PostDominatorTree() : FunctionPass(ID) {
     DT = new DominatorTreeBase<BasicBlock>(true);
   }
 
@@ -36,19 +36,23 @@ struct PostDominatorTree : public FunctionPass {
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
   }
-  
+
   inline const std::vector<BasicBlock*> &getRoots() const {
     return DT->getRoots();
   }
-  
+
   inline DomTreeNode *getRootNode() const {
     return DT->getRootNode();
   }
-  
+
   inline DomTreeNode *operator[](BasicBlock *BB) const {
     return DT->getNode(BB);
   }
-  
+
+  inline DomTreeNode *getNode(BasicBlock *BB) const {
+    return DT->getNode(BB);
+  }
+
   inline bool dominates(DomTreeNode* A, DomTreeNode* B) const {
     return DT->dominates(A, B);
   }
@@ -60,11 +64,15 @@ struct PostDominatorTree : public FunctionPass {
   inline bool properlyDominates(const DomTreeNode* A, DomTreeNode* B) const {
     return DT->properlyDominates(A, B);
   }
-  
+
   inline bool properlyDominates(BasicBlock* A, BasicBlock* B) const {
     return DT->properlyDominates(A, B);
   }
 
+  inline BasicBlock *findNearestCommonDominator(BasicBlock *A, BasicBlock *B) {
+    return DT->findNearestCommonDominator(A, B);
+  }
+
   virtual void releaseMemory() {
     DT->releaseMemory();
   }
@@ -97,8 +105,8 @@ template <> struct GraphTraits<PostDominatorTree*>
 ///
 struct PostDominanceFrontier : public DominanceFrontierBase {
   static char ID;
-  PostDominanceFrontier() 
-    : DominanceFrontierBase(&ID, true) {}
+  PostDominanceFrontier()
+    : DominanceFrontierBase(ID, true) {}
 
   virtual bool runOnFunction(Function &) {
     Frontiers.clear();