LLVM API Documentation
00001 //====- X86MachineFuctionInfo.h - X86 machine function info -----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file declares X86-specific per-machine-function information. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef X86MACHINEFUNCTIONINFO_H 00015 #define X86MACHINEFUNCTIONINFO_H 00016 00017 #include "llvm/CodeGen/MachineFunction.h" 00018 00019 namespace llvm { 00020 00021 enum NameDecorationStyle { 00022 None, 00023 StdCall, 00024 FastCall 00025 }; 00026 00027 /// X86MachineFunctionInfo - This class is derived from MachineFunction private 00028 /// X86 target-specific information for each MachineFunction. 00029 class X86MachineFunctionInfo : public MachineFunctionInfo { 00030 /// ForceFramePointer - True if the function is required to use of frame 00031 /// pointer for reasons other than it containing dynamic allocation or 00032 /// that FP eliminatation is turned off. For example, Cygwin main function 00033 /// contains stack pointer re-alignment code which requires FP. 00034 bool ForceFramePointer; 00035 00036 /// CalleeSavedFrameSize - Size of the callee-saved register portion of the 00037 /// stack frame in bytes. 00038 unsigned CalleeSavedFrameSize; 00039 00040 /// BytesToPopOnReturn - Number of bytes function pops on return. 00041 /// Used on windows platform for stdcall & fastcall name decoration 00042 unsigned BytesToPopOnReturn; 00043 00044 /// DecorationStyle - If the function requires additional name decoration, 00045 /// DecorationStyle holds the right way to do so. 00046 NameDecorationStyle DecorationStyle; 00047 00048 /// ReturnAddrIndex - FrameIndex for return slot. 00049 int ReturnAddrIndex; 00050 00051 /// TailCallReturnAddrDelta - Delta the ReturnAddr stack slot is moved 00052 /// Used for creating an area before the register spill area on the stack 00053 /// the returnaddr can be savely move to this area 00054 int TailCallReturnAddrDelta; 00055 00056 /// SRetReturnReg - Some subtargets require that sret lowering includes 00057 /// returning the value of the returned struct in a register. This field 00058 /// holds the virtual register into which the sret argument is passed. 00059 unsigned SRetReturnReg; 00060 00061 /// GlobalBaseReg - keeps track of the virtual register initialized for 00062 /// use as the global base register. This is used for PIC in some PIC 00063 /// relocation models. 00064 unsigned GlobalBaseReg; 00065 00066 public: 00067 X86MachineFunctionInfo() : ForceFramePointer(false), 00068 CalleeSavedFrameSize(0), 00069 BytesToPopOnReturn(0), 00070 DecorationStyle(None), 00071 ReturnAddrIndex(0), 00072 TailCallReturnAddrDelta(0), 00073 SRetReturnReg(0), 00074 GlobalBaseReg(0) {} 00075 00076 X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false), 00077 CalleeSavedFrameSize(0), 00078 BytesToPopOnReturn(0), 00079 DecorationStyle(None), 00080 ReturnAddrIndex(0), 00081 TailCallReturnAddrDelta(0), 00082 SRetReturnReg(0), 00083 GlobalBaseReg(0) {} 00084 00085 bool getForceFramePointer() const { return ForceFramePointer;} 00086 void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; } 00087 00088 unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; } 00089 void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; } 00090 00091 unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; } 00092 void setBytesToPopOnReturn (unsigned bytes) { BytesToPopOnReturn = bytes;} 00093 00094 NameDecorationStyle getDecorationStyle() const { return DecorationStyle; } 00095 void setDecorationStyle(NameDecorationStyle style) { DecorationStyle = style;} 00096 00097 int getRAIndex() const { return ReturnAddrIndex; } 00098 void setRAIndex(int Index) { ReturnAddrIndex = Index; } 00099 00100 int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; } 00101 void setTCReturnAddrDelta(int delta) {TailCallReturnAddrDelta = delta;} 00102 00103 unsigned getSRetReturnReg() const { return SRetReturnReg; } 00104 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } 00105 00106 unsigned getGlobalBaseReg() const { return GlobalBaseReg; } 00107 void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } 00108 }; 00109 } // End llvm namespace 00110 00111 #endif
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.