~ubuntu-branches/ubuntu/feisty/clamav/feisty

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/Target/X86/X86MachineFunctionInfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-20 10:33:44 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20070220103344-zgcu2psnx9d98fpa
Tags: upstream-0.90
ImportĀ upstreamĀ versionĀ 0.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
/// X86MachineFunctionInfo - This class is derived from MachineFunction and
22
 
/// contains private X86 target-specific information for each MachineFunction.
23
 
class X86MachineFunctionInfo : public MachineFunctionInfo {
24
 
  /// ForceFramePointer - True if the function is required to use of frame
25
 
  /// pointer for reasons other than it containing dynamic allocation or 
26
 
  /// that FP eliminatation is turned off. For example, Cygwin main function
27
 
  /// contains stack pointer re-alignment code which requires FP.
28
 
  bool ForceFramePointer;
29
 
 
30
 
  /// CalleeSavedFrameSize - Size of the callee-saved register portion of the
31
 
  /// stack frame in bytes.
32
 
  unsigned CalleeSavedFrameSize;
33
 
 
34
 
  /// BytesToPopOnReturn - Number of bytes function pops on return (in addition
35
 
  /// to the space used by the return address).
36
 
  /// Used on windows platform for stdcall & fastcall name decoration
37
 
  unsigned BytesToPopOnReturn;
38
 
 
39
 
  /// ReturnAddrIndex - FrameIndex for return slot.
40
 
  int ReturnAddrIndex;
41
 
 
42
 
  /// TailCallReturnAddrDelta - The number of bytes by which return address
43
 
  /// stack slot is moved as the result of tail call optimization.
44
 
  int TailCallReturnAddrDelta;
45
 
 
46
 
  /// SRetReturnReg - Some subtargets require that sret lowering includes
47
 
  /// returning the value of the returned struct in a register. This field
48
 
  /// holds the virtual register into which the sret argument is passed.
49
 
  unsigned SRetReturnReg;
50
 
 
51
 
  /// GlobalBaseReg - keeps track of the virtual register initialized for
52
 
  /// use as the global base register. This is used for PIC in some PIC
53
 
  /// relocation models.
54
 
  unsigned GlobalBaseReg;
55
 
 
56
 
  /// ReserveFP - whether the function should reserve the frame pointer
57
 
  /// when allocating, even if there may not actually be a frame pointer used.
58
 
  bool ReserveFP;
59
 
 
60
 
  /// VarArgsFrameIndex - FrameIndex for start of varargs area.
61
 
  int VarArgsFrameIndex;
62
 
  /// RegSaveFrameIndex - X86-64 vararg func register save area.
63
 
  int RegSaveFrameIndex;
64
 
  /// VarArgsGPOffset - X86-64 vararg func int reg offset.
65
 
  unsigned VarArgsGPOffset;
66
 
  /// VarArgsFPOffset - X86-64 vararg func fp reg offset.
67
 
  unsigned VarArgsFPOffset;
68
 
 
69
 
public:
70
 
  X86MachineFunctionInfo() : ForceFramePointer(false),
71
 
                             CalleeSavedFrameSize(0),
72
 
                             BytesToPopOnReturn(0),
73
 
                             ReturnAddrIndex(0),
74
 
                             TailCallReturnAddrDelta(0),
75
 
                             SRetReturnReg(0),
76
 
                             GlobalBaseReg(0),
77
 
                             VarArgsFrameIndex(0),
78
 
                             RegSaveFrameIndex(0),
79
 
                             VarArgsGPOffset(0),
80
 
                             VarArgsFPOffset(0) {}
81
 
  
82
 
  explicit X86MachineFunctionInfo(MachineFunction &MF)
83
 
    : ForceFramePointer(false),
84
 
      CalleeSavedFrameSize(0),
85
 
      BytesToPopOnReturn(0),
86
 
      ReturnAddrIndex(0),
87
 
      TailCallReturnAddrDelta(0),
88
 
      SRetReturnReg(0),
89
 
      GlobalBaseReg(0),
90
 
      ReserveFP(false),
91
 
      VarArgsFrameIndex(0),
92
 
      RegSaveFrameIndex(0),
93
 
      VarArgsGPOffset(0),
94
 
      VarArgsFPOffset(0) {}
95
 
  
96
 
  bool getForceFramePointer() const { return ForceFramePointer;} 
97
 
  void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; }
98
 
 
99
 
  unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
100
 
  void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
101
 
 
102
 
  unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; }
103
 
  void setBytesToPopOnReturn (unsigned bytes) { BytesToPopOnReturn = bytes;}
104
 
 
105
 
  int getRAIndex() const { return ReturnAddrIndex; }
106
 
  void setRAIndex(int Index) { ReturnAddrIndex = Index; }
107
 
 
108
 
  int getTCReturnAddrDelta() const { return TailCallReturnAddrDelta; }
109
 
  void setTCReturnAddrDelta(int delta) {TailCallReturnAddrDelta = delta;}
110
 
 
111
 
  unsigned getSRetReturnReg() const { return SRetReturnReg; }
112
 
  void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
113
 
 
114
 
  unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
115
 
  void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
116
 
 
117
 
  bool getReserveFP() const { return ReserveFP; }
118
 
  void setReserveFP(bool reserveFP) { ReserveFP = reserveFP; }
119
 
 
120
 
  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
121
 
  void setVarArgsFrameIndex(int Idx) { VarArgsFrameIndex = Idx; }
122
 
 
123
 
  int getRegSaveFrameIndex() const { return RegSaveFrameIndex; }
124
 
  void setRegSaveFrameIndex(int Idx) { RegSaveFrameIndex = Idx; }
125
 
 
126
 
  unsigned getVarArgsGPOffset() const { return VarArgsGPOffset; }
127
 
  void setVarArgsGPOffset(unsigned Offset) { VarArgsGPOffset = Offset; }
128
 
 
129
 
  unsigned getVarArgsFPOffset() const { return VarArgsFPOffset; }
130
 
  void setVarArgsFPOffset(unsigned Offset) { VarArgsFPOffset = Offset; }
131
 
};
132
 
 
133
 
} // End llvm namespace
134
 
 
135
 
#endif