From 1970a89a49a76ef117c92e58a508e26ecc43ccdb Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Mon, 29 Jun 2009 18:49:09 +0000 Subject: 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 --- lib/Analysis/LoopPass.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Analysis/LoopPass.cpp') diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 08c25f4..ee03556 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::const_iterator I = LQ.begin(), E = LQ.end(); I != E; ++I) { -- cgit v1.1