Fix a use of an invalid iterator when -debug-pass=Details is used.
authorDan Gohman <gohman@apple.com>
Thu, 6 Nov 2008 21:57:17 +0000 (21:57 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 6 Nov 2008 21:57:17 +0000 (21:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58816 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/PassManager.cpp

index 6f559c47c3f166de994a2f453c65a0513c693eae..690c485fe20d65aa54d4b3fb82510afc4234bbfb 100644 (file)
@@ -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);
     }
   }