diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-07-25 00:32:41 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-07-25 00:32:41 +0000 |
commit | a9cc8c0385736c1e97dd672516bcf26f61cf8d97 (patch) | |
tree | 16b16157c08643dcba7c4b7d4e2ea07d083004fc | |
parent | 869950e9e0dc41cbfefbb3ff194ec34939ad7274 (diff) | |
download | bcm5719-llvm-a9cc8c0385736c1e97dd672516bcf26f61cf8d97.tar.gz bcm5719-llvm-a9cc8c0385736c1e97dd672516bcf26f61cf8d97.zip |
Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.
llvm-svn: 187092
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 04355e252e0..1bf49184fcf 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -412,13 +412,10 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { // Set frame pointer elimination mode. if (!CodeGenOpts.DisableFPElim) { Options.NoFramePointerElim = false; - Options.NoFramePointerElimNonLeaf = false; } else if (CodeGenOpts.OmitLeafFramePointer) { Options.NoFramePointerElim = false; - Options.NoFramePointerElimNonLeaf = true; } else { Options.NoFramePointerElim = true; - Options.NoFramePointerElimNonLeaf = true; } if (CodeGenOpts.UseInitArray) diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 0a202ef5d4f..9a38771aa45 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1072,6 +1072,18 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, CodeGenOpts.SoftFloat ? "true" : "false"); FuncAttrs.addAttribute("stack-protector-buffer-size", llvm::utostr(CodeGenOpts.SSPBufferSize)); + + bool NoFramePointerElimNonLeaf; + if (!CodeGenOpts.DisableFPElim) { + NoFramePointerElimNonLeaf = false; + } else if (CodeGenOpts.OmitLeafFramePointer) { + NoFramePointerElimNonLeaf = true; + } else { + NoFramePointerElimNonLeaf = true; + } + + FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf", + NoFramePointerElimNonLeaf ? "true" : "false"); } QualType RetTy = FI.getReturnType(); |