[llvm] r206744 - [PM] Fix a bug where we didn't properly clear the list map when the list

Chandler Carruth chandlerc at gmail.com
Mon Apr 21 04:11:54 PDT 2014


Author: chandlerc
Date: Mon Apr 21 06:11:54 2014
New Revision: 206744

URL: http://llvm.org/viewvc/llvm-project?rev=206744&view=rev
Log:
[PM] Fix a bug where we didn't properly clear the list map when the list
became empty. This would manifest later as an assert failure due to
a non-empty list map but an empty result map. This doesn't easily
manifest with just the module pass manager and the function pass
manager, but the next commit will add the CGSCC pass manager that hits
this assert immediately.

Modified:
    llvm/trunk/lib/IR/PassManager.cpp

Modified: llvm/trunk/lib/IR/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/PassManager.cpp?rev=206744&r1=206743&r2=206744&view=diff
==============================================================================
--- llvm/trunk/lib/IR/PassManager.cpp (original)
+++ llvm/trunk/lib/IR/PassManager.cpp Mon Apr 21 06:11:54 2014
@@ -165,6 +165,8 @@ void FunctionAnalysisManager::invalidate
   while (!InvalidatedPassIDs.empty())
     FunctionAnalysisResults.erase(
         std::make_pair(InvalidatedPassIDs.pop_back_val(), F));
+  if (ResultsList.empty())
+    FunctionAnalysisResultLists.erase(F);
 }
 
 char FunctionAnalysisManagerModuleProxy::PassID;





More information about the llvm-commits mailing list