From a9cc8c0385736c1e97dd672516bcf26f61cf8d97 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 25 Jul 2013 00:32:41 +0000 Subject: Replace the "NoFramePointerElimNonLeaf" target option with a function attribute. llvm-svn: 187092 --- clang/lib/CodeGen/CGCall.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/lib/CodeGen/CGCall.cpp') 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(); -- cgit v1.2.3