Reuse code. Directly use runOnFunction().
authorDevang Patel <dpatel@apple.com>
Fri, 8 Dec 2006 19:03:05 +0000 (19:03 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 8 Dec 2006 19:03:05 +0000 (19:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32370 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/PassManager.cpp

index 64585f9399594d26469bb18ccca64d6f7befddf4..6b6921cedde61926044a7129e4fe3bb1451533ce 100644 (file)
@@ -844,16 +844,8 @@ bool FunctionPassManagerImpl_New::runOnModule(Module &M) {
   initializeAnalysisInfo();
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    for (std::vector<Pass *>::iterator itr = passVectorBegin(),
-           e = passVectorEnd(); itr != e; ++itr) {
-      Pass *P = *itr;
-      
-      FunctionPass *FP = dynamic_cast<FunctionPass*>(P);
-      Changed |= FP->runOnFunction(*I);
-      removeNotPreservedAnalysis(P);
-      recordAvailableAnalysis(P);
-      removeDeadPasses(P);
-    }
+    this->runOnFunction(*I);
+
   return Changed;
 }