Simplify some getNode calls.
[oota-llvm.git] / lib / VMCore / PassManager.cpp
index 312379479d6a65dcda5c7adc1c47b703e4bf5a24..e1f8afe3b0ea069f77589a5e26e8ac05ab080731 100644 (file)
@@ -360,10 +360,10 @@ public:
   }
 };
 
-static TimingInfo *TheTimeInfo;
-
 } // End of anon namespace
 
+static TimingInfo *TheTimeInfo;
+
 //===----------------------------------------------------------------------===//
 // PMTopLevelManager implementation
 
@@ -621,9 +621,15 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
     std::map<AnalysisID, Pass*>::iterator Info = I++;
     if (!dynamic_cast<ImmutablePass*>(Info->second)
         && std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == 
-           PreservedSet.end())
+        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";
+      }
+    }
   }
 
   // Check inherited analysis also. If P is not preserving analysis
@@ -659,6 +665,12 @@ void PMDataManager::removeDeadPasses(Pass *P, const char *Msg,
 
   TPM->collectLastUses(DeadPasses, P);
 
+  if (PassDebugging >= Details && !DeadPasses.empty()) {
+    cerr << " -*- " <<  P->getPassName();
+    cerr << " is the last user of following pass instances.";
+    cerr << " Free these instances\n";
+  }
+
   for (SmallVector<Pass *, 12>::iterator I = DeadPasses.begin(),
          E = DeadPasses.end(); I != E; ++I) {
 
@@ -924,7 +936,11 @@ void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
   // When Pass manager is not able to order required analysis info, Pass manager
   // checks whether any lower level manager will be able to provide this 
   // analysis info on demand or not.
-  assert (0 && "Unable to handle Pass that requires lower level Analysis pass");
+#ifndef NDEBUG
+  cerr << "Unable to schedule " << RequiredPass->getPassName();
+  cerr << " required by " << P->getPassName() << "\n";
+#endif
+  assert (0 && "Unable to schedule pass");
 }
 
 // Destructor