1 //====- X86MachineFuctionInfo.h - X86 machine function info -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares X86-specific per-machine-function information.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86MACHINEFUNCTIONINFO_H
15 #define X86MACHINEFUNCTIONINFO_H
17 #include "llvm/CodeGen/MachineFunction.h"
21 enum NameDecorationStyle {
27 /// X86MachineFunctionInfo - This class is derived from MachineFunction private
28 /// 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;
36 /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
37 /// stack frame in bytes.
38 unsigned CalleeSavedFrameSize;
40 /// BytesToPopOnReturn - Number of bytes function pops on return.
41 /// Used on windows platform for stdcall & fastcall name decoration
42 unsigned BytesToPopOnReturn;
44 /// DecorationStyle - If the function requires additional name decoration,
45 /// DecorationStyle holds the right way to do so.
46 NameDecorationStyle DecorationStyle;
48 /// ReturnAddrIndex - FrameIndex for return slot.
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;
57 X86MachineFunctionInfo() : ForceFramePointer(false),
58 CalleeSavedFrameSize(0),
59 BytesToPopOnReturn(0),
60 DecorationStyle(None),
62 TailCallReturnAddrDelta(0) {}
64 X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false),
65 CalleeSavedFrameSize(0),
66 BytesToPopOnReturn(0),
67 DecorationStyle(None),
69 TailCallReturnAddrDelta(0) {}
71 bool getForceFramePointer() const { return ForceFramePointer;}
72 void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; }
74 unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
75 void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
77 unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }
78 void setBytesToPopOnReturn (unsigned bytes) { BytesToPopOnReturn = bytes;}
80 NameDecorationStyle getDecorationStyle() const { return DecorationStyle; }
81 void setDecorationStyle(NameDecorationStyle style) { DecorationStyle = style;}
83 int getRAIndex() const { return ReturnAddrIndex; }
84 void setRAIndex(int Index) { ReturnAddrIndex = Index; }
86 int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; }
87 void setTCReturnAddrDelta(int delta) {TailCallReturnAddrDelta = delta;}
89 } // End llvm namespace