Turn StripPointerCast() into a method
[oota-llvm.git] / lib / VMCore / Dominators.cpp
index b909a0014cdea86cb8572597625bd28eec22a3c8..5aa3f34e876e76c553ab5eee5bd37ea19b242dbe 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -54,21 +54,10 @@ TEMPLATE_INSTANTIATION(class DominatorTreeBase<BasicBlock>);
 
 char DominatorTree::ID = 0;
 static RegisterPass<DominatorTree>
-E("domtree", "Dominator Tree Construction", true);
+E("domtree", "Dominator Tree Construction", true, true);
 
 bool DominatorTree::runOnFunction(Function &F) {
-  reset();     // Reset from the last time we were run...
-  
-  // Initialize roots
-  Roots.push_back(&F.getEntryBlock());
-  IDoms[&F.getEntryBlock()] = 0;
-  DomTreeNodes[&F.getEntryBlock()] = 0;
-  Vertex.push_back(0);
-  
-  Calculate<BasicBlock*, GraphTraits<BasicBlock*> >(*this, F);
-  
-  updateDFSNumbers();
-  
+  DT->recalculate(F);
   return false;
 }
 
@@ -78,7 +67,7 @@ bool DominatorTree::runOnFunction(Function &F) {
 
 char DominanceFrontier::ID = 0;
 static RegisterPass<DominanceFrontier>
-G("domfrontier", "Dominance Frontier Construction", true);
+G("domfrontier", "Dominance Frontier Construction", false, true);
 
 // NewBB is split and now it has one successor. Update dominace frontier to
 // reflect this change.