Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit e4f49eb

Browse files
committedNov 1, 2018
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 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@345884 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 13b5a61 commit e4f49eb

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed
 

‎COFF/LTO.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ static std::unique_ptr<lto::LTO> createLTO() {
6060
C.DisableVerify = true;
6161
C.DiagHandler = diagnosticHandler;
6262
C.OptLevel = Config->LTOO;
63+
C.MAttrs = GetMAttrs();
64+
6365
if (Config->SaveTemps)
6466
checkError(C.addSaveTemps(std::string(Config->OutputFile) + ".",
6567
/*UseInputModulePath*/ true));

‎Common/TargetOptionsCommandFlags.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ llvm::Optional<llvm::CodeModel::Model> lld::GetCodeModelFromCMModel() {
3232
}
3333

3434
std::string lld::GetCPUStr() { return ::getCPUStr(); }
35+
std::vector<std::string> lld::GetMAttrs() { return ::MAttrs; }

‎ELF/LTO.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static lto::Config createConfig() {
8888
C.DiagHandler = diagnosticHandler;
8989
C.OptLevel = Config->LTOO;
9090
C.CPU = GetCPUStr();
91+
C.MAttrs = GetMAttrs();
9192

9293
// Set up a custom pipeline if we've been asked to.
9394
C.OptPipeline = Config->LTONewPmPasses;

‎include/lld/Common/TargetOptionsCommandFlags.h

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ namespace lld {
1919
llvm::TargetOptions InitTargetOptionsFromCodeGenFlags();
2020
llvm::Optional<llvm::CodeModel::Model> GetCodeModelFromCMModel();
2121
std::string GetCPUStr();
22+
std::vector<std::string> GetMAttrs();
2223
}

‎wasm/LTO.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static std::unique_ptr<lto::LTO> createLTO() {
5555
C.DisableVerify = Config->DisableVerify;
5656
C.DiagHandler = diagnosticHandler;
5757
C.OptLevel = Config->LTOO;
58+
C.MAttrs = GetMAttrs();
5859

5960
if (Config->SaveTemps)
6061
checkError(C.addSaveTemps(Config->OutputFile.str() + ".",

0 commit comments

Comments
 (0)
This repository has been archived.