[llvm] r189063 - Check only if we have this attribute. If it's not an attribute, then it's assumed false.

Bill Wendling isanbard at gmail.com
Thu Aug 22 14:16:14 PDT 2013


Author: void
Date: Thu Aug 22 16:16:14 2013
New Revision: 189063

URL: http://llvm.org/viewvc/llvm-project?rev=189063&view=rev
Log:
Check only if we have this attribute. If it's not an attribute, then it's assumed false.

Modified:
    llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp

Modified: llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp?rev=189063&r1=189062&r2=189063&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetOptionsImpl.cpp Thu Aug 22 16:16:14 2013
@@ -22,10 +22,8 @@ using namespace llvm;
 bool TargetOptions::DisableFramePointerElim(const MachineFunction &MF) const {
   // Check to see if we should eliminate non-leaf frame pointers and then
   // check to see if we should eliminate all frame pointers.
-  bool NoFramePointerElimNonLeaf =
-    MF.getFunction()->getFnAttribute("no-frame-pointer-elim-non-leaf")
-      .getValueAsString() == "true";
-  if (NoFramePointerElimNonLeaf && !NoFramePointerElim) {
+  if (MF.getFunction()->hasFnAttribute("no-frame-pointer-elim-non-leaf") &&
+      !NoFramePointerElim) {
     const MachineFrameInfo *MFI = MF.getFrameInfo();
     return MFI->hasCalls();
   }





More information about the llvm-commits mailing list