From: Eric Christopher Date: Tue, 20 May 2014 21:25:41 +0000 (+0000) Subject: Update for llvm change to avoid having global flag setting in TargetMachine. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=addbfc942181c163fe2fb2e436dcbcf0594ded1d;p=clang Update for llvm change to avoid having global flag setting in TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209239 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 1a5213ee8f..16a8c0efa4 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -376,9 +376,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { TargetMachine::setAsmVerbosityDefault(CodeGenOpts.AsmVerbose); - TargetMachine::setFunctionSections(CodeGenOpts.FunctionSections); - TargetMachine::setDataSections (CodeGenOpts.DataSections); - unsigned CodeModel = llvm::StringSwitch(CodeGenOpts.CodeModel) .Case("small", llvm::CodeModel::Small) @@ -491,6 +488,8 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { Options.DisableTailCalls = CodeGenOpts.DisableTailCalls; Options.TrapFuncName = CodeGenOpts.TrapFuncName; Options.PositionIndependentExecutable = LangOpts.PIELevel != 0; + Options.FunctionSections = CodeGenOpts.FunctionSections; + Options.DataSections = CodeGenOpts.DataSections; Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll; Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;