From 8d230b454fa3a0d4fd87453e24c88219ef5ad14a Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 12 Jul 2013 22:26:07 +0000 Subject: [PATCH] Use function attributes to pass along the stack protector buffer size instead of making it a target option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186218 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/BackendUtil.cpp | 1 - lib/CodeGen/CGCall.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index e3a44f982d..04355e252e 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -458,7 +458,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { Options.DisableTailCalls = CodeGenOpts.DisableTailCalls; Options.TrapFuncName = CodeGenOpts.TrapFuncName; Options.PositionIndependentExecutable = LangOpts.PIELevel != 0; - Options.SSPBufferSize = CodeGenOpts.SSPBufferSize; Options.EnableSegmentedStacks = CodeGenOpts.EnableSegmentedStacks; TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU, diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 9ed50ec67d..45c6790940 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1070,6 +1070,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, CodeGenOpts.UnsafeFPMath ? "true" : "false"); FuncAttrs.addAttribute("use-soft-float", CodeGenOpts.SoftFloat ? "true" : "false"); + FuncAttrs.addAttribute("ssp-buffer-size", + llvm::utostr(CodeGenOpts.SSPBufferSize)); } QualType RetTy = FI.getReturnType(); -- 2.40.0