Check only if we have this attribute. If it's not an attribute, then it's assumed...
authorBill Wendling <isanbard@gmail.com>
Thu, 22 Aug 2013 21:16:14 +0000 (21:16 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 22 Aug 2013 21:16:14 +0000 (21:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189063 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetOptionsImpl.cpp

index 7a39a4c27374c9e8180c969860c43b9b8d6791f3..f7bf86b2c653b51d67a13c85c032734f30dd9f23 100644 (file)
@@ -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();
   }