[llvm-commits] [llvm] r103774 - /llvm/trunk/tools/opt/opt.cpp
Dan Gohman
gohman at apple.com
Fri May 14 08:36:54 PDT 2010
Author: djg
Date: Fri May 14 10:36:54 2010
New Revision: 103774
URL: http://llvm.org/viewvc/llvm-project?rev=103774&view=rev
Log:
Use regular PassManager instead of FunctionPassManager in opt, since it
isn't doing lazy streaming. This also fixes a missing doFinalization call.
Modified:
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=103774&r1=103773&r2=103774&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Fri May 14 10:36:54 2010
@@ -268,7 +268,7 @@
};
char BasicBlockPassPrinter::ID = 0;
-inline void addPass(PassManager &PM, Pass *P) {
+inline void addPass(PassManagerBase &PM, Pass *P) {
// Add the pass to the pass manager...
PM.add(P);
@@ -281,7 +281,7 @@
/// duplicates llvm-gcc behaviour.
///
/// OptLevel - Optimization Level
-void AddOptimizationPasses(PassManager &MPM, FunctionPassManager &FPM,
+void AddOptimizationPasses(PassManagerBase &MPM, PassManagerBase &FPM,
unsigned OptLevel) {
createStandardFunctionPasses(&FPM, OptLevel);
@@ -305,7 +305,7 @@
InliningPass);
}
-void AddStandardCompilePasses(PassManager &PM) {
+void AddStandardCompilePasses(PassManagerBase &PM) {
PM.add(createVerifierPass()); // Verify that input is correct
addPass(PM, createLowerSetJmpPass()); // Lower llvm.setjmp/.longjmp
@@ -328,7 +328,7 @@
InliningPass);
}
-void AddStandardLinkPasses(PassManager &PM) {
+void AddStandardLinkPasses(PassManagerBase &PM) {
PM.add(createVerifierPass()); // Verify that input is correct
// If the -strip-debug command line option was specified, do it.
@@ -422,9 +422,9 @@
if (TD)
Passes.add(TD);
- OwningPtr<FunctionPassManager> FPasses;
+ OwningPtr<PassManager> FPasses;
if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
- FPasses.reset(new FunctionPassManager(M.get()));
+ FPasses.reset(new PassManager());
if (TD)
FPasses->add(new TargetData(*TD));
}
@@ -521,12 +521,8 @@
if (OptLevelO3)
AddOptimizationPasses(Passes, *FPasses, 3);
- if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
- FPasses->doInitialization();
- for (Module::iterator I = M.get()->begin(), E = M.get()->end();
- I != E; ++I)
- FPasses->run(*I);
- }
+ if (OptLevelO1 || OptLevelO2 || OptLevelO3)
+ FPasses->run(*M.get());
// Check that the module is well formed on completion of optimization
if (!NoVerify && !VerifyEach)
More information about the llvm-commits
mailing list