[llvm] r176257 - Add the -disable-opt option to LTO. This adds:
Bill Wendling
isanbard at gmail.com
Thu Feb 28 06:11:10 PST 2013
Author: void
Date: Thu Feb 28 08:11:10 2013
New Revision: 176257
URL: http://llvm.org/viewvc/llvm-project?rev=176257&view=rev
Log:
Add the -disable-opt option to LTO. This adds:
- Consistency with opt (which supports the same option with the same meaning and
description).
- Debugging gold plugin-based linking without optimizations getting in the way.
- Debugging programs linked with the gold plugin while preserving the original
debug info.
- Fine-grained control over LTO passes using the gold plugin in combination with
opt (or clang/dragonegg).
Patch by Cristiano Giuffrida!
Modified:
llvm/trunk/tools/lto/LTOCodeGenerator.cpp
Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=176257&r1=176256&r2=176257&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Thu Feb 28 08:11:10 2013
@@ -47,6 +47,10 @@
using namespace llvm;
static cl::opt<bool>
+DisableOpt("disable-opt", cl::init(false),
+ cl::desc("Do not run any optimization passes"));
+
+static cl::opt<bool>
DisableInline("disable-inlining", cl::init(false),
cl::desc("Do not run the inliner pass"));
@@ -376,10 +380,12 @@ bool LTOCodeGenerator::generateObjectFil
// Enabling internalize here would use its AllButMain variant. It
// keeps only main if it exists and does nothing for libraries. Instead
// we create the pass ourselves with the symbol list provided by the linker.
- PassManagerBuilder().populateLTOPassManager(passes,
+ if (!DisableOpt) {
+ PassManagerBuilder().populateLTOPassManager(passes,
/*Internalize=*/false,
!DisableInline,
DisableGVNLoadPRE);
+ }
// Make sure everything is still good.
passes.add(createVerifierPass());
More information about the llvm-commits
mailing list