Move some logic to populateLTOPassManager.

This will avoid code duplication in the next commit which calls it directly
from the gold plugin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216211 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-08-21 20:03:44 +00:00
parent 9db660ecaa
commit 7b4eb02b6d
4 changed files with 57 additions and 38 deletions

View File

@@ -254,18 +254,12 @@ static void AddStandardCompilePasses(PassManagerBase &PM) {
}
static void AddStandardLinkPasses(PassManagerBase &PM) {
PM.add(createVerifierPass()); // Verify that input is correct
// If the -strip-debug command line option was specified, do it.
if (StripDebug)
addPass(PM, createStripSymbolsPass(true));
// Verify debug info only after it's (possibly) stripped.
PM.add(createDebugInfoVerifierPass());
if (DisableOptimizations) return;
PassManagerBuilder Builder;
Builder.VerifyInput = true;
Builder.StripDebug = StripDebug;
if (DisableOptimizations)
Builder.OptLevel = 0;
if (!DisableInline)
Builder.Inliner = createFunctionInliningPass();
Builder.populateLTOPassManager(PM);