forked from OSchip/llvm-project
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 llvm-svn: 345884
This commit is contained in:
parent
4af6025f09
commit
ccfc8415c2
|
@ -60,6 +60,8 @@ static std::unique_ptr<lto::LTO> createLTO() {
|
|||
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));
|
||||
|
|
|
@ -32,3 +32,4 @@ llvm::Optional<llvm::CodeModel::Model> lld::GetCodeModelFromCMModel() {
|
|||
}
|
||||
|
||||
std::string lld::GetCPUStr() { return ::getCPUStr(); }
|
||||
std::vector<std::string> lld::GetMAttrs() { return ::MAttrs; }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -19,4 +19,5 @@ namespace lld {
|
|||
llvm::TargetOptions InitTargetOptionsFromCodeGenFlags();
|
||||
llvm::Optional<llvm::CodeModel::Model> GetCodeModelFromCMModel();
|
||||
std::string GetCPUStr();
|
||||
std::vector<std::string> GetMAttrs();
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ static std::unique_ptr<lto::LTO> createLTO() {
|
|||
C.DisableVerify = Config->DisableVerify;
|
||||
C.DiagHandler = diagnosticHandler;
|
||||
C.OptLevel = Config->LTOO;
|
||||
C.MAttrs = GetMAttrs();
|
||||
|
||||
if (Config->SaveTemps)
|
||||
checkError(C.addSaveTemps(Config->OutputFile.str() + ".",
|
||||
|
|
Loading…
Reference in New Issue