From f245ae5a4a78d5a02b3b9e2dae819077a56d81e7 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 25 Jul 2013 00:34:29 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187093 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/TargetOptionsImpl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/CodeGen/TargetOptionsImpl.cpp') diff --git a/lib/CodeGen/TargetOptionsImpl.cpp b/lib/CodeGen/TargetOptionsImpl.cpp index b5d4160f93..7a39a4c273 100644 --- a/lib/CodeGen/TargetOptionsImpl.cpp +++ b/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(); -- cgit v1.2.3