Fix X86MachineFunctionInfo's doxygen comment.
[oota-llvm.git] / lib / Target / X86 / X86MachineFunctionInfo.h
1 //====- X86MachineFuctionInfo.h - X86 machine function info -----*- C++ -*-===//
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 declares X86-specific per-machine-function information.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef X86MACHINEFUNCTIONINFO_H
15 #define X86MACHINEFUNCTIONINFO_H
16
17 #include "llvm/CodeGen/MachineFunction.h"
18
19 namespace llvm {
20
21 enum NameDecorationStyle {
22   None,
23   StdCall,
24   FastCall
25 };
26   
27 /// X86MachineFunctionInfo - This class is derived from MachineFunction and
28 /// contains private X86 target-specific information for each MachineFunction.
29 class X86MachineFunctionInfo : public MachineFunctionInfo {
30   /// ForceFramePointer - True if the function is required to use of frame
31   /// pointer for reasons other than it containing dynamic allocation or 
32   /// that FP eliminatation is turned off. For example, Cygwin main function
33   /// contains stack pointer re-alignment code which requires FP.
34   bool ForceFramePointer;
35
36   /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
37   /// stack frame in bytes.
38   unsigned CalleeSavedFrameSize;
39
40   /// BytesToPopOnReturn - Number of bytes function pops on return.
41   /// Used on windows platform for stdcall & fastcall name decoration
42   unsigned BytesToPopOnReturn;
43
44   /// DecorationStyle - If the function requires additional name decoration,
45   /// DecorationStyle holds the right way to do so.
46   NameDecorationStyle DecorationStyle;
47
48   /// ReturnAddrIndex - FrameIndex for return slot.
49   int ReturnAddrIndex;
50
51   /// TailCallReturnAddrDelta - Delta the ReturnAddr stack slot is moved
52   /// Used for creating an area before the register spill area on the stack
53   /// the returnaddr can be savely move to this area
54   int TailCallReturnAddrDelta;
55
56   /// SRetReturnReg - Some subtargets require that sret lowering includes
57   /// returning the value of the returned struct in a register. This field
58   /// holds the virtual register into which the sret argument is passed.
59   unsigned SRetReturnReg;
60
61   /// GlobalBaseReg - keeps track of the virtual register initialized for
62   /// use as the global base register. This is used for PIC in some PIC
63   /// relocation models.
64   unsigned GlobalBaseReg;
65
66 public:
67   X86MachineFunctionInfo() : ForceFramePointer(false),
68                              CalleeSavedFrameSize(0),
69                              BytesToPopOnReturn(0),
70                              DecorationStyle(None),
71                              ReturnAddrIndex(0),
72                              TailCallReturnAddrDelta(0),
73                              SRetReturnReg(0),
74                              GlobalBaseReg(0) {}
75   
76   X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false),
77                                                 CalleeSavedFrameSize(0),
78                                                 BytesToPopOnReturn(0),
79                                                 DecorationStyle(None),
80                                                 ReturnAddrIndex(0),
81                                                 TailCallReturnAddrDelta(0),
82                                                 SRetReturnReg(0),
83                                                 GlobalBaseReg(0) {}
84   
85   bool getForceFramePointer() const { return ForceFramePointer;} 
86   void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; }
87
88   unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
89   void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
90
91   unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }
92   void setBytesToPopOnReturn (unsigned bytes) { BytesToPopOnReturn = bytes;}
93
94   NameDecorationStyle getDecorationStyle() const { return DecorationStyle; }
95   void setDecorationStyle(NameDecorationStyle style) { DecorationStyle = style;}
96
97   int getRAIndex() const { return ReturnAddrIndex; }
98   void setRAIndex(int Index) { ReturnAddrIndex = Index; }
99
100   int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; }
101   void setTCReturnAddrDelta(int delta) {TailCallReturnAddrDelta = delta;}
102
103   unsigned getSRetReturnReg() const { return SRetReturnReg; }
104   void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
105
106   unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
107   void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
108 };
109
110 } // End llvm namespace
111
112 #endif