aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit24c7835d19a4a7bfa87e5859a072bc23a0df1429 (patch)
tree9c5a1e2a945ebed9b6b60cfd2fbab0e2855d3955 /llvm/lib/Analysis/LoopPass.cpp
parente00beaaee8d1e63e0f086bf9ff91e099a7e40a08 (diff)
downloadllvm-24c7835d19a4a7bfa87e5859a072bc23a0df1429.zip
llvm-24c7835d19a4a7bfa87e5859a072bc23a0df1429.tar.gz
llvm-24c7835d19a4a7bfa87e5859a072bc23a0df1429.tar.bz2
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. llvm-svn: 74438
Diffstat (limited to 'llvm/lib/Analysis/LoopPass.cpp')
-rw-r--r--llvm/lib/Analysis/LoopPass.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index 08c25f4..ee03556 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/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) {