Don't verify passes when assertions are disabled.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54446 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index e2baecb..4392bee 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -598,8 +598,12 @@
   return true;
 }
 
-/// verifyPreservedAnalysis -- Verify analysis presreved by pass P.
+/// verifyPreservedAnalysis -- Verify analysis preserved by pass P.
 void PMDataManager::verifyPreservedAnalysis(Pass *P) {
+  // Don't do this unless assertions are enabled.
+#ifdef NDEBUG
+  return;
+#endif
   AnalysisUsage AnUsage;
   P->getAnalysisUsage(AnUsage);
   const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
@@ -608,8 +612,7 @@
   for (std::vector<AnalysisID>::const_iterator I = PreservedSet.begin(),
          E = PreservedSet.end(); I != E; ++I) {
     AnalysisID AID = *I;
-    Pass *AP = findAnalysisPass(AID, true);
-    if (AP)
+    if (Pass *AP = findAnalysisPass(AID, true))
       AP->verifyAnalysis();
   }
 }
@@ -1318,7 +1321,7 @@
       dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG,
                    M.getModuleIdentifier().c_str());
     dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet());
-      
+    
     verifyPreservedAnalysis(MP);
     removeNotPreservedAnalysis(MP);
     recordAvailableAnalysis(MP);