diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-08-22 21:16:14 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-08-22 21:16:14 +0000 |
commit | 062cd9437ff0de45e321f8ddb04f876a4fd90e33 (patch) | |
tree | 10509c48eebbb1f8ccf146926e412a082ca84365 /lib/CodeGen/TargetOptionsImpl.cpp | |
parent | b4be7f6b04c990d6bd969e7304d350de45c87f04 (diff) | |
download | llvm-062cd9437ff0de45e321f8ddb04f876a4fd90e33.tar.gz llvm-062cd9437ff0de45e321f8ddb04f876a4fd90e33.tar.bz2 llvm-062cd9437ff0de45e321f8ddb04f876a4fd90e33.tar.xz |
Check only if we have this attribute. If it's not an attribute, then it's assumed false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetOptionsImpl.cpp')
-rw-r--r-- | lib/CodeGen/TargetOptionsImpl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/TargetOptionsImpl.cpp b/lib/CodeGen/TargetOptionsImpl.cpp index 7a39a4c273..f7bf86b2c6 100644 --- a/lib/CodeGen/TargetOptionsImpl.cpp +++ b/lib/CodeGen/TargetOptionsImpl.cpp @@ -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(); } |