mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
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:
@ -458,32 +458,21 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
|
||||
// Instantiate the pass manager to organize the passes.
|
||||
PassManager passes;
|
||||
|
||||
// Start off with a verification pass.
|
||||
passes.add(createVerifierPass());
|
||||
passes.add(createDebugInfoVerifierPass());
|
||||
|
||||
// Add an appropriate DataLayout instance for this module...
|
||||
mergedModule->setDataLayout(TargetMach->getSubtargetImpl()->getDataLayout());
|
||||
passes.add(new DataLayoutPass(mergedModule));
|
||||
|
||||
TargetMach->addAnalysisPasses(passes);
|
||||
|
||||
Triple TargetTriple(TargetMach->getTargetTriple());
|
||||
// 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.
|
||||
if (!DisableOpt) {
|
||||
PassManagerBuilder PMB;
|
||||
PMB.DisableGVNLoadPRE = DisableGVNLoadPRE;
|
||||
if (!DisableInline)
|
||||
PMB.Inliner = createFunctionInliningPass();
|
||||
PMB.LibraryInfo = new TargetLibraryInfo(TargetTriple);
|
||||
PMB.populateLTOPassManager(passes);
|
||||
}
|
||||
PassManagerBuilder PMB;
|
||||
PMB.DisableGVNLoadPRE = DisableGVNLoadPRE;
|
||||
if (!DisableInline)
|
||||
PMB.Inliner = createFunctionInliningPass();
|
||||
PMB.LibraryInfo = new TargetLibraryInfo(TargetTriple);
|
||||
if (DisableOpt)
|
||||
PMB.OptLevel = 0;
|
||||
PMB.VerifyInput = true;
|
||||
PMB.VerifyOutput = true;
|
||||
|
||||
// Make sure everything is still good.
|
||||
passes.add(createVerifierPass());
|
||||
passes.add(createDebugInfoVerifierPass());
|
||||
PMB.populateLTOPassManager(passes, TargetMach);
|
||||
|
||||
PassManager codeGenPasses;
|
||||
|
||||
|
Reference in New Issue
Block a user