summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetOptionsImpl.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-07-25 00:34:29 +0000
committerBill Wendling <isanbard@gmail.com>2013-07-25 00:34:29 +0000
commit440e9d81bf02746146c3fc817d87c3b8ef1416b2 (patch)
tree25d36dd55f9f254d5419d1511fb2adb6f7e616c1 /llvm/lib/CodeGen/TargetOptionsImpl.cpp
parenta9cc8c0385736c1e97dd672516bcf26f61cf8d97 (diff)
downloadbcm5719-llvm-440e9d81bf02746146c3fc817d87c3b8ef1416b2.tar.gz
bcm5719-llvm-440e9d81bf02746146c3fc817d87c3b8ef1416b2.zip
Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.
There's no need to specify a flag to omit frame pointer elimination on non-leaf nodes...(Honestly, I can't parse that option out.) Use the function attribute stuff instead. llvm-svn: 187093
Diffstat (limited to 'llvm/lib/CodeGen/TargetOptionsImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetOptionsImpl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetOptionsImpl.cpp b/llvm/lib/CodeGen/TargetOptionsImpl.cpp
index b5d4160f939..7a39a4c2737 100644
--- a/llvm/lib/CodeGen/TargetOptionsImpl.cpp
+++ b/llvm/lib/CodeGen/TargetOptionsImpl.cpp
@@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/IR/Function.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/Target/TargetOptions.h"
@@ -21,6 +22,9 @@ 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) {
const MachineFrameInfo *MFI = MF.getFrameInfo();
return MFI->hasCalls();
OpenPOWER on IntegriCloud