Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187092 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 0a202ef..9a38771 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1072,6 +1072,18 @@
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();