LLVM  6.0.0svn
TargetOptionsImpl.cpp
Go to the documentation of this file.
1 //===-- TargetOptionsImpl.cpp - Options that apply to all targets ----------==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the methods in the TargetOptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
18 #include "llvm/IR/Function.h"
19 #include "llvm/IR/Module.h"
21 using namespace llvm;
22 
23 /// DisableFramePointerElim - This returns true if frame pointer elimination
24 /// optimization should be disabled for the given machine function.
26  // Check to see if we should eliminate all frame pointers.
28  return true;
29 
30  // Check to see if we should eliminate non-leaf frame pointers.
31  if (MF.getFunction()->hasFnAttribute("no-frame-pointer-elim-non-leaf"))
32  return MF.getFrameInfo().hasCalls();
33 
34  return false;
35 }
36 
37 /// HonorSignDependentRoundingFPMath - Return true if the codegen must assume
38 /// that the rounding mode of the FPU can change from its default.
41 }
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool HonorSignDependentRoundingFPMath() const
HonorSignDependentRoundingFPMath - Return true if the codegen must assume that the rounding mode of t...
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition: Function.h:262
virtual bool noFramePointerElim(const MachineFunction &MF) const
Return true if the target needs to disable frame pointer elimination.
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Module.h This file contains the declarations for the Module class.
virtual const TargetFrameLowering * getFrameLowering() const
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
unsigned HonorSignDependentRoundingFPMathOption
HonorSignDependentRoundingFPMath - This returns true when the -enable-sign-dependent-rounding-fp-math...
bool hasCalls() const
Return true if the current function has any function calls.