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 | fe88aea70675c0fe588307af9b4999c7f7446df6 (patch) | |
tree | 0a51f8036bbff551958bff686af80649bff16c3b /llvm/lib/CodeGen/TargetOptionsImpl.cpp | |
parent | 6e33ae64c4fe9df1f05de1f052e6e3ab0e747f89 (diff) | |
download | llvm-fe88aea70675c0fe588307af9b4999c7f7446df6.zip llvm-fe88aea70675c0fe588307af9b4999c7f7446df6.tar.gz llvm-fe88aea70675c0fe588307af9b4999c7f7446df6.tar.bz2 |
Check only if we have this attribute. If it's not an attribute, then it's assumed false.
llvm-svn: 189063
Diffstat (limited to 'llvm/lib/CodeGen/TargetOptionsImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetOptionsImpl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetOptionsImpl.cpp b/llvm/lib/CodeGen/TargetOptionsImpl.cpp index 7a39a4c..f7bf86b 100644 --- a/llvm/lib/CodeGen/TargetOptionsImpl.cpp +++ b/llvm/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(); } |