diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/LTO/LTOBackend.cpp | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/LTO/LTOBackend.cpp')
| -rw-r--r-- | gnu/llvm/lib/LTO/LTOBackend.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/gnu/llvm/lib/LTO/LTOBackend.cpp b/gnu/llvm/lib/LTO/LTOBackend.cpp index eadbb410bd5..926c419e34a 100644 --- a/gnu/llvm/lib/LTO/LTOBackend.cpp +++ b/gnu/llvm/lib/LTO/LTOBackend.cpp @@ -138,9 +138,15 @@ createTargetMachine(Config &Conf, const Target *TheTarget, Module &M) { RelocModel = M.getPICLevel() == PICLevel::NotPIC ? Reloc::Static : Reloc::PIC_; + Optional<CodeModel::Model> CodeModel; + if (Conf.CodeModel) + CodeModel = *Conf.CodeModel; + else + CodeModel = M.getCodeModel(); + return std::unique_ptr<TargetMachine>(TheTarget->createTargetMachine( TheTriple, Conf.CPU, Features.getString(), Conf.Options, RelocModel, - Conf.CodeModel, Conf.CGOptLevel)); + CodeModel, Conf.CGOptLevel)); } static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM, @@ -149,13 +155,14 @@ static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM, const ModuleSummaryIndex *ImportSummary) { Optional<PGOOptions> PGOOpt; if (!Conf.SampleProfile.empty()) - PGOOpt = PGOOptions("", "", Conf.SampleProfile, false, true); + PGOOpt = PGOOptions("", "", Conf.SampleProfile, Conf.ProfileRemapping, + false, true); PassBuilder PB(TM, PGOOpt); AAManager AA; // Parse a custom AA pipeline if asked to. - if (!PB.parseAAPipeline(AA, "default")) + if (auto Err = PB.parseAAPipeline(AA, "default")) report_fatal_error("Error parsing default AA pipeline"); LoopAnalysisManager LAM(Conf.DebugPassManager); @@ -214,9 +221,9 @@ static void runNewPMCustomPasses(Module &Mod, TargetMachine *TM, // Parse a custom AA pipeline if asked to. if (!AAPipelineDesc.empty()) - if (!PB.parseAAPipeline(AA, AAPipelineDesc)) - report_fatal_error("unable to parse AA pipeline description: " + - AAPipelineDesc); + if (auto Err = PB.parseAAPipeline(AA, AAPipelineDesc)) + report_fatal_error("unable to parse AA pipeline description '" + + AAPipelineDesc + "': " + toString(std::move(Err))); LoopAnalysisManager LAM; FunctionAnalysisManager FAM; @@ -239,9 +246,9 @@ static void runNewPMCustomPasses(Module &Mod, TargetMachine *TM, MPM.addPass(VerifierPass()); // Now, add all the passes we've been requested to. - if (!PB.parsePassPipeline(MPM, PipelineDesc)) - report_fatal_error("unable to parse pass pipeline description: " + - PipelineDesc); + if (auto Err = PB.parsePassPipeline(MPM, PipelineDesc)) + report_fatal_error("unable to parse pass pipeline description '" + + PipelineDesc + "': " + toString(std::move(Err))); if (!DisableVerify) MPM.addPass(VerifierPass()); @@ -483,7 +490,7 @@ Error lto::thinBackend(Config &Conf, unsigned Task, AddStreamFn AddStream, dropDeadSymbols(Mod, DefinedGlobals, CombinedIndex); - thinLTOResolveWeakForLinkerModule(Mod, DefinedGlobals); + thinLTOResolvePrevailingInModule(Mod, DefinedGlobals); if (Conf.PostPromoteModuleHook && !Conf.PostPromoteModuleHook(Task, Mod)) return finalizeOptimizationRemarks(std::move(DiagnosticOutputFile)); |
