[llvm-commits] [llvm] r68256 - in /llvm/branches/Apple/Dib: include/llvm/PassAnalysisSupport.h include/llvm/PassManagers.h lib/VMCore/PassManager.cpp

Bill Wendling isanbard at gmail.com
Wed Apr 1 15:39:53 PDT 2009


Author: void
Date: Wed Apr  1 17:39:52 2009
New Revision: 68256

URL: http://llvm.org/viewvc/llvm-project?rev=68256&view=rev
Log:
--- Merging (from foreign repository) r68254 into '.':
U    include/llvm/PassAnalysisSupport.h
U    include/llvm/PassManagers.h
U    lib/VMCore/PassManager.cpp

Clean up pass manager cache after each run.

Modified:
    llvm/branches/Apple/Dib/include/llvm/PassAnalysisSupport.h
    llvm/branches/Apple/Dib/include/llvm/PassManagers.h
    llvm/branches/Apple/Dib/lib/VMCore/PassManager.cpp

Modified: llvm/branches/Apple/Dib/include/llvm/PassAnalysisSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/PassAnalysisSupport.h?rev=68256&r1=68255&r2=68256&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/PassAnalysisSupport.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/PassAnalysisSupport.h Wed Apr  1 17:39:52 2009
@@ -143,6 +143,12 @@
     AnalysisImpls.push_back(pir);
   }
 
+  /// clearAnalysisImpls - Clear cache that is used to connect a pass to the
+  /// the analysis (PassInfo).
+  void clearAnalysisImpls() {
+    AnalysisImpls.clear();
+  }
+
   // getAnalysisIfAvailable - Return analysis result or null if it doesn't exist
   Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const;
 

Modified: llvm/branches/Apple/Dib/include/llvm/PassManagers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/PassManagers.h?rev=68256&r1=68255&r2=68256&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/PassManagers.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/PassManagers.h Wed Apr  1 17:39:52 2009
@@ -414,6 +414,9 @@
   /// whether any of the passes modifies the module, and if so, return true.
   bool runOnFunction(Function &F);
   bool runOnModule(Module &M);
+  
+  /// cleanup - After running all passes, clean up pass manager cache.
+  void cleanup();
 
   /// doInitialization - Run all of the initializers for the function passes.
   ///

Modified: llvm/branches/Apple/Dib/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/VMCore/PassManager.cpp?rev=68256&r1=68255&r2=68256&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/VMCore/PassManager.cpp (original)
+++ llvm/branches/Apple/Dib/lib/VMCore/PassManager.cpp Wed Apr  1 17:39:52 2009
@@ -1267,6 +1267,16 @@
   return Changed;
 }
 
+/// cleanup - After running all passes, clean up pass manager cache.
+void FPPassManager::cleanup() {
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+    FunctionPass *FP = getContainedPass(Index);
+    AnalysisResolver *AR = FP->getResolver();
+    assert(AR && "Analysis Resolver is not set");
+    AR->clearAnalysisImpls();
+ }
+}
+
 // Execute all the passes managed by this top level manager.
 // Return true if any function is modified by a pass.
 bool FunctionPassManagerImpl::run(Function &F) {
@@ -1279,6 +1289,10 @@
   initializeAllAnalysisInfo();
   for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index)
     Changed |= getContainedManager(Index)->runOnFunction(F);
+
+  for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index)
+    getContainedManager(Index)->cleanup();
+
   return Changed;
 }
 





More information about the llvm-commits mailing list