From: Eric Christopher Date: Thu, 15 May 2014 01:21:56 +0000 (+0000) Subject: Fill in the options in the MCOptions struct directly like the other X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8454a4b9373bca5d2a8f596ef1c33826171729bd;p=clang Fill in the options in the MCOptions struct directly like the other options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208834 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 9ea0a3ab37..79c7e8bd5e 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -492,19 +492,15 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { Options.TrapFuncName = CodeGenOpts.TrapFuncName; Options.PositionIndependentExecutable = LangOpts.PIELevel != 0; + Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll; + Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels; + Options.MCOptions.MCUseDwarfDirectory = CodeGenOpts.NoDwarfDirectoryAsm; + Options.MCOptions.MCNoExecStack = CodeGenOpts.NoExecStack; + TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU, FeaturesStr, Options, RM, CM, OptLevel); - if (CodeGenOpts.RelaxAll) - TM->setMCRelaxAll(true); - if (CodeGenOpts.SaveTempLabels) - TM->setMCSaveTempLabels(true); - if (!CodeGenOpts.NoDwarfDirectoryAsm) - TM->setMCUseDwarfDirectory(true); - if (CodeGenOpts.NoExecStack) - TM->setMCNoExecStack(true); - return TM; }