]> granicus.if.org Git - clang/commitdiff
Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.
authorBill Wendling <isanbard@gmail.com>
Thu, 25 Jul 2013 00:32:41 +0000 (00:32 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 25 Jul 2013 00:32:41 +0000 (00:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187092 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CGCall.cpp

index 04355e252e06b9d6f67a5f0bb2aa4010b49b25ec..1bf49184fcf86a2e435604101b1245ac26c4bb1d 100644 (file)
@@ -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)
index 0a202ef5d4f894d51ab7fb6bb4c60725ae01d498..9a38771aa45c204573083daea6e623ef65eda660 100644 (file)
@@ -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();