r187092 - Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.

Bill Wendling isanbard at gmail.com
Wed Jul 24 17:32:41 PDT 2013


Author: void
Date: Wed Jul 24 19:32:41 2013
New Revision: 187092

URL: http://llvm.org/viewvc/llvm-project?rev=187092&view=rev
Log:
Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/lib/CodeGen/CGCall.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=187092&r1=187091&r2=187092&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Wed Jul 24 19:32:41 2013
@@ -412,13 +412,10 @@ TargetMachine *EmitAssemblyHelper::Creat
   // 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)

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=187092&r1=187091&r2=187092&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Wed Jul 24 19:32:41 2013
@@ -1072,6 +1072,18 @@ void CodeGenModule::ConstructAttributeLi
                            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();





More information about the cfe-commits mailing list