diff options
author | Devang Patel <dpatel@apple.com> | 2009-04-01 22:34:41 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-04-01 22:34:41 +0000 |
commit | 9dfa1671fc5ba478530ba88877dd508dac20bac4 (patch) | |
tree | 0185e6d3a1dce50ad0dbff76db0474b340eabdcf /lib/VMCore | |
parent | 5867de1243c7e43d7bbd5e90287106e3feb7e9e6 (diff) | |
download | external_llvm-9dfa1671fc5ba478530ba88877dd508dac20bac4.zip external_llvm-9dfa1671fc5ba478530ba88877dd508dac20bac4.tar.gz external_llvm-9dfa1671fc5ba478530ba88877dd508dac20bac4.tar.bz2 |
Clean up pass manager cache after each run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index dd03548..2e9fa53 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -1267,6 +1267,16 @@ bool FunctionPassManagerImpl::doFinalization(Module &M) { 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 @@ bool FunctionPassManagerImpl::run(Function &F) { 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; } |