During runOnModule() do initialization and finalization.
authorDevang Patel <dpatel@apple.com>
Fri, 8 Dec 2006 19:04:09 +0000 (19:04 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 8 Dec 2006 19:04:09 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32371 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/PassManager.cpp

index 6b6921cedde61926044a7129e4fe3bb1451533ce..be9bff4d3d402deb7305786c1a0bf9f73bc223bf 100644 (file)
@@ -840,13 +840,13 @@ FunctionPassManagerImpl_New::addPass(Pass *P) {
 /// the function, and if so, return true.
 bool FunctionPassManagerImpl_New::runOnModule(Module &M) {
 
-  bool Changed = false;
+  bool Changed = doInitialization(M);
   initializeAnalysisInfo();
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     this->runOnFunction(*I);
 
-  return Changed;
+  return Changed | doFinalization(M);
 }
 
 /// Execute all of the passes scheduled for execution by invoking