[lld] r345884 - Set MAttrs in LTO mode
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 1 13:02:50 PDT 2018
Author: maskray
Date: Thu Nov 1 13:02:49 2018
New Revision: 345884
URL: http://llvm.org/viewvc/llvm-project?rev=345884&view=rev
Log:
Set MAttrs in LTO mode
Summary: Without this patch, MAttrs are not set.
Patch by Yin Ma
Reviewers: espindola, MaskRay, ruiu, pcc
Reviewed By: MaskRay, pcc
Subscribers: pcc, emaste, sbc100, inglorion, arichardson, aheejin, steven_wu, llvm-commits
Differential Revision: https://reviews.llvm.org/D53446
Modified:
lld/trunk/COFF/LTO.cpp
lld/trunk/Common/TargetOptionsCommandFlags.cpp
lld/trunk/ELF/LTO.cpp
lld/trunk/include/lld/Common/TargetOptionsCommandFlags.h
lld/trunk/wasm/LTO.cpp
Modified: lld/trunk/COFF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/LTO.cpp?rev=345884&r1=345883&r2=345884&view=diff
==============================================================================
--- lld/trunk/COFF/LTO.cpp (original)
+++ lld/trunk/COFF/LTO.cpp Thu Nov 1 13:02:49 2018
@@ -60,6 +60,8 @@ static std::unique_ptr<lto::LTO> createL
C.DisableVerify = true;
C.DiagHandler = diagnosticHandler;
C.OptLevel = Config->LTOO;
+ C.MAttrs = GetMAttrs();
+
if (Config->SaveTemps)
checkError(C.addSaveTemps(std::string(Config->OutputFile) + ".",
/*UseInputModulePath*/ true));
Modified: lld/trunk/Common/TargetOptionsCommandFlags.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/Common/TargetOptionsCommandFlags.cpp?rev=345884&r1=345883&r2=345884&view=diff
==============================================================================
--- lld/trunk/Common/TargetOptionsCommandFlags.cpp (original)
+++ lld/trunk/Common/TargetOptionsCommandFlags.cpp Thu Nov 1 13:02:49 2018
@@ -32,3 +32,4 @@ llvm::Optional<llvm::CodeModel::Model> l
}
std::string lld::GetCPUStr() { return ::getCPUStr(); }
+std::vector<std::string> lld::GetMAttrs() { return ::MAttrs; }
Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=345884&r1=345883&r2=345884&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Thu Nov 1 13:02:49 2018
@@ -88,6 +88,7 @@ static lto::Config createConfig() {
C.DiagHandler = diagnosticHandler;
C.OptLevel = Config->LTOO;
C.CPU = GetCPUStr();
+ C.MAttrs = GetMAttrs();
// Set up a custom pipeline if we've been asked to.
C.OptPipeline = Config->LTONewPmPasses;
Modified: lld/trunk/include/lld/Common/TargetOptionsCommandFlags.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Common/TargetOptionsCommandFlags.h?rev=345884&r1=345883&r2=345884&view=diff
==============================================================================
--- lld/trunk/include/lld/Common/TargetOptionsCommandFlags.h (original)
+++ lld/trunk/include/lld/Common/TargetOptionsCommandFlags.h Thu Nov 1 13:02:49 2018
@@ -19,4 +19,5 @@ namespace lld {
llvm::TargetOptions InitTargetOptionsFromCodeGenFlags();
llvm::Optional<llvm::CodeModel::Model> GetCodeModelFromCMModel();
std::string GetCPUStr();
+std::vector<std::string> GetMAttrs();
}
Modified: lld/trunk/wasm/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/LTO.cpp?rev=345884&r1=345883&r2=345884&view=diff
==============================================================================
--- lld/trunk/wasm/LTO.cpp (original)
+++ lld/trunk/wasm/LTO.cpp Thu Nov 1 13:02:49 2018
@@ -55,6 +55,7 @@ static std::unique_ptr<lto::LTO> createL
C.DisableVerify = Config->DisableVerify;
C.DiagHandler = diagnosticHandler;
C.OptLevel = Config->LTOO;
+ C.MAttrs = GetMAttrs();
if (Config->SaveTemps)
checkError(C.addSaveTemps(Config->OutputFile.str() + ".",
More information about the llvm-commits
mailing list