llvm.org GIT mirror llvm / 6303b66
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176257 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 6 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4646 using namespace llvm;
4747
4848 static cl::opt
49 DisableOpt("disable-opt", cl::init(false),
50 cl::desc("Do not run any optimization passes"));
51
52 static cl::opt
4953 DisableInline("disable-inlining", cl::init(false),
5054 cl::desc("Do not run the inliner pass"));
5155
375379 // Enabling internalize here would use its AllButMain variant. It
376380 // keeps only main if it exists and does nothing for libraries. Instead
377381 // we create the pass ourselves with the symbol list provided by the linker.
378 PassManagerBuilder().populateLTOPassManager(passes,
382 if (!DisableOpt) {
383 PassManagerBuilder().populateLTOPassManager(passes,
379384 /*Internalize=*/false,
380385 !DisableInline,
381386 DisableGVNLoadPRE);
387 }
382388
383389 // Make sure everything is still good.
384390 passes.add(createVerifierPass());