aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-27 23:43:07 +0000
committerDan Gohman <gohman@apple.com>2009-09-27 23:43:07 +0000
commit72a3f38563c08ff695f37880ca47a0212d5eef8f (patch)
tree7035d744d8a770f8a49bc081c9043cd9bd5a3d57 /lib/Analysis
parenta27e7c0803f1ec6bd2b58dce5df419100c761c52 (diff)
downloadexternal_llvm-72a3f38563c08ff695f37880ca47a0212d5eef8f.zip
external_llvm-72a3f38563c08ff695f37880ca47a0212d5eef8f.tar.gz
external_llvm-72a3f38563c08ff695f37880ca47a0212d5eef8f.tar.bz2
When a loop is deleted, immediately release all of the active
LoopPasses for that loop. This avoids trouble with the PassManager trying to call verifyAnalysis on them, and frees up some memory sooner rather than later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/LoopPass.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp
index 08615c4..4f7018d 100644
--- a/lib/Analysis/LoopPass.cpp
+++ b/lib/Analysis/LoopPass.cpp
@@ -253,6 +253,15 @@ bool LPPassManager::runOnFunction(Function &F) {
break;
}
+ // If the loop was deleted, release all the loop passes. This frees up
+ // some memory, and avoids trouble with the pass manager trying to call
+ // verifyAnalysis on them.
+ if (skipThisLoop)
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ Pass *P = getContainedPass(Index);
+ freePass(P, "", ON_LOOP_MSG);
+ }
+
// Pop the loop from queue after running all passes.
LQ.pop_back();