[dragonegg] r210441 - Use PassManager instead of FunctionPassManager in CodeGen. r210280 has introduced ModulePass in CodeGenPass.

NAKAMURA Takumi geek4civic at gmail.com
Sun Jun 8 15:20:22 PDT 2014


Author: chapuni
Date: Sun Jun  8 17:20:22 2014
New Revision: 210441

URL: http://llvm.org/viewvc/llvm-project?rev=210441&view=rev
Log:
Use PassManager instead of FunctionPassManager in CodeGen. r210280 has introduced ModulePass in CodeGenPass.

Modified:
    dragonegg/trunk/src/Backend.cpp

Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=210441&r1=210440&r2=210441&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Sun Jun  8 17:20:22 2014
@@ -152,7 +152,7 @@ std::vector<Constant *> AttributeAnnotat
 /// code generator.
 static FunctionPassManager *PerFunctionPasses = 0;
 static PassManager *PerModulePasses = 0;
-static FunctionPassManager *CodeGenPasses = 0;
+static PassManager *CodeGenPasses = 0;
 
 static void createPerFunctionOptimizationPasses();
 static void createPerModuleOptimizationPasses();
@@ -780,8 +780,7 @@ static void createPerModuleOptimizationP
     // FIXME: This is disabled right now until bugs can be worked out.  Reenable
     // this for fast -O0 compiles!
     if (PerModulePasses || 1) {
-      FunctionPassManager *PM = CodeGenPasses =
-          new FunctionPassManager(TheModule);
+      PassManager *PM = CodeGenPasses = new PassManager();
       PM->add(new DataLayoutPass(*TheTarget->getDataLayout()));
       TheTarget->addAnalysisPasses(*PM);
 
@@ -1980,12 +1979,7 @@ static void llvm_finish_unit(void */*gcc
     void *OldHandlerData = Context.getInlineAsmDiagnosticContext();
     Context.setInlineAsmDiagnosticHandler(InlineAsmDiagnosticHandler, 0);
 
-    CodeGenPasses->doInitialization();
-    for (Module::iterator I = TheModule->begin(), E = TheModule->end(); I != E;
-         ++I)
-      if (!I->isDeclaration())
-        CodeGenPasses->run(*I);
-    CodeGenPasses->doFinalization();
+    CodeGenPasses->run(*TheModule);
 
     Context.setInlineAsmDiagnosticHandler(OldHandler, OldHandlerData);
   }





More information about the llvm-commits mailing list