[cfe-commits] r114171 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp
Daniel Dunbar
daniel at zuster.org
Fri Sep 17 00:35:17 PDT 2010
Author: ddunbar
Date: Fri Sep 17 02:35:16 2010
New Revision: 114171
URL: http://llvm.org/viewvc/llvm-project?rev=114171&view=rev
Log:
IRgen: Change CodeGenPasses to be a PassManager, so it can have CallGraphSCC or
Module. Patch by Mike Gist!
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=114171&r1=114170&r2=114171&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Sep 17 02:35:16 2010
@@ -42,14 +42,14 @@
Timer CodeGenerationTime;
- mutable FunctionPassManager *CodeGenPasses;
+ mutable PassManager *CodeGenPasses;
mutable PassManager *PerModulePasses;
mutable FunctionPassManager *PerFunctionPasses;
private:
- FunctionPassManager *getCodeGenPasses() const {
+ PassManager *getCodeGenPasses() const {
if (!CodeGenPasses) {
- CodeGenPasses = new FunctionPassManager(TheModule);
+ CodeGenPasses = new PassManager();
CodeGenPasses->add(new TargetData(TheModule));
}
return CodeGenPasses;
@@ -248,7 +248,7 @@
TM->setMCRelaxAll(true);
// Create the code generator passes.
- FunctionPassManager *PM = getCodeGenPasses();
+ PassManager *PM = getCodeGenPasses();
CodeGenOpt::Level OptLevel = CodeGenOpt::Default;
switch (CodeGenOpts.OptimizationLevel) {
@@ -320,13 +320,7 @@
if (CodeGenPasses) {
PrettyStackTraceString CrashInfo("Code generation");
-
- 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);
}
}
More information about the cfe-commits
mailing list