PassInfo keep tracks whether a pass is an analysis pass or not.
[oota-llvm.git] / lib / VMCore / PassManager.cpp
index 7db6aa2643d804ac13660fd89f380533451e875c..6c8d0624e6849c4d557fa5623bebb6a33eee6e6c 100644 (file)
@@ -426,11 +426,14 @@ void PMTopLevelManager::schedulePass(Pass *P) {
   // Give pass a chance to prepare the stage.
   P->preparePassManager(activeStack);
 
+#if 1
   // If P is an analysis pass and it is available then do not
   // generate the analysis again. Stale analysis info should not be
   // available at this point.
-  if (P->isAnalysis() && findAnalysisPass(P->getPassInfo()))
+  if (P->getPassInfo() &&
+      P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo()))
     return;
+#endif
 
   AnalysisUsage AnUsage;
   P->getAnalysisUsage(AnUsage);