We need to propagate the debug location information even when dealing with the
[oota-llvm.git] / lib / VMCore / PassManager.cpp
index 6f559c47c3f166de994a2f453c65a0513c693eae..4335757a5093ca7f81c83fae037ba51b064161d2 100644 (file)
@@ -679,7 +679,7 @@ void PMDataManager::verifyDomInfo(Pass &P, Function &F) {
   if (!VerifyDomInfo || !P.getResolver())
     return;
 
-  DominatorTree *DT = P.getAnalysisToUpdate<DominatorTree>();
+  DominatorTree *DT = P.getAnalysisIfAvailable<DominatorTree>();
   if (!DT)
     return;
 
@@ -695,7 +695,7 @@ void PMDataManager::verifyDomInfo(Pass &P, Function &F) {
     assert (0 && "Invalid dominator info");
   }
 
-  DominanceFrontier *DF = P.getAnalysisToUpdate<DominanceFrontier>();
+  DominanceFrontier *DF = P.getAnalysisIfAvailable<DominanceFrontier>();
   if (!DF) 
     return;
 
@@ -727,12 +727,12 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
         && std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == 
         PreservedSet.end()) {
       // Remove this analysis
-      AvailableAnalysis.erase(Info);
       if (PassDebugging >= Details) {
         Pass *S = Info->second;
         cerr << " -- '" <<  P->getPassName() << "' is not preserving '";
         cerr << S->getPassName() << "'\n";
       }
+      AvailableAnalysis.erase(Info);
     }
   }
 
@@ -1088,8 +1088,8 @@ PMDataManager::~PMDataManager() {
 
 //===----------------------------------------------------------------------===//
 // NOTE: Is this the right place to define this method ?
-// getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
-Pass *AnalysisResolver::getAnalysisToUpdate(AnalysisID ID, bool dir) const {
+// getAnalysisIfAvailable - Return analysis result or null if it doesn't exist.
+Pass *AnalysisResolver::getAnalysisIfAvailable(AnalysisID ID, bool dir) const {
   return PM.findAnalysisPass(ID, dir);
 }
 
@@ -1140,7 +1140,7 @@ BBPassManager::runOnFunction(Function &F) {
 }
 
 // Implement doInitialization and doFinalization
-inline bool BBPassManager::doInitialization(Module &M) {
+bool BBPassManager::doInitialization(Module &M) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -1151,7 +1151,7 @@ inline bool BBPassManager::doInitialization(Module &M) {
   return Changed;
 }
 
-inline bool BBPassManager::doFinalization(Module &M) {
+bool BBPassManager::doFinalization(Module &M) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -1162,7 +1162,7 @@ inline bool BBPassManager::doFinalization(Module &M) {
   return Changed;
 }
 
-inline bool BBPassManager::doInitialization(Function &F) {
+bool BBPassManager::doInitialization(Function &F) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -1173,7 +1173,7 @@ inline bool BBPassManager::doInitialization(Function &F) {
   return Changed;
 }
 
-inline bool BBPassManager::doFinalization(Function &F) {
+bool BBPassManager::doFinalization(Function &F) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -1242,7 +1242,7 @@ bool FunctionPassManager::doFinalization() {
 //===----------------------------------------------------------------------===//
 // FunctionPassManagerImpl implementation
 //
-inline bool FunctionPassManagerImpl::doInitialization(Module &M) {
+bool FunctionPassManagerImpl::doInitialization(Module &M) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {  
@@ -1253,7 +1253,7 @@ inline bool FunctionPassManagerImpl::doInitialization(Module &M) {
   return Changed;
 }
 
-inline bool FunctionPassManagerImpl::doFinalization(Module &M) {
+bool FunctionPassManagerImpl::doFinalization(Module &M) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {  
@@ -1348,7 +1348,7 @@ bool FPPassManager::runOnModule(Module &M) {
   return Changed |= doFinalization(M);
 }
 
-inline bool FPPassManager::doInitialization(Module &M) {
+bool FPPassManager::doInitialization(Module &M) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {  
@@ -1359,7 +1359,7 @@ inline bool FPPassManager::doInitialization(Module &M) {
   return Changed;
 }
 
-inline bool FPPassManager::doFinalization(Module &M) {
+bool FPPassManager::doFinalization(Module &M) {
   bool Changed = false;
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {