summaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-06-29 18:49:09 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-06-29 18:49:09 +0000
commit1970a89a49a76ef117c92e58a508e26ecc43ccdb (patch)
tree56539d6317c9e4dae91160a7e433aa721e1a8598 /lib/Analysis/LoopPass.cpp
parent23737e04235b6cab4c51546887397a9e53bf757c (diff)
downloadllvm-1970a89a49a76ef117c92e58a508e26ecc43ccdb.tar.gz
llvm-1970a89a49a76ef117c92e58a508e26ecc43ccdb.tar.bz2
llvm-1970a89a49a76ef117c92e58a508e26ecc43ccdb.tar.xz
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.cpp3
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) {