diff options
author | Torok Edwin <edwintorok@gmail.com> | 2009-06-29 18:49:09 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2009-06-29 18:49:09 +0000 |
commit | 1970a89a49a76ef117c92e58a508e26ecc43ccdb (patch) | |
tree | 56539d6317c9e4dae91160a7e433aa721e1a8598 /lib/Analysis/LoopPass.cpp | |
parent | 23737e04235b6cab4c51546887397a9e53bf757c (diff) |
Call doInitialization(), releaseMemory(), and doFinalization() for on-the-fly passes as well.
Also don't call finalizers for LoopPass if initialization was not called.
Add a unittest that tests that these methods are called, in the proper
order, and the correct number of times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopPass.cpp')
-rw-r--r-- | lib/Analysis/LoopPass.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 08c25f4cea..ee03556f27 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -195,6 +195,9 @@ bool LPPassManager::runOnFunction(Function &F) { for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) addLoopIntoQueue(*I, LQ); + if (LQ.empty()) // No loops, skip calling finalizers + return false; + // Initialization for (std::deque<Loop *>::const_iterator I = LQ.begin(), E = LQ.end(); I != E; ++I) { |