Add integer register size field.
[oota-llvm.git] / include / llvm / Target / TargetFrameInfo.h
1 // $Id$ -*-c++-*-
2 //***************************************************************************
3 // File:
4 //      MachineFrameInfo.h
5 // 
6 // Purpose:
7 //      Interface to layout of stack frame on target machine.
8 // 
9 // History:
10 //      11/6/01  -  Vikram Adve  -  Created
11 //**************************************************************************/
12
13 #ifndef LLVM_CODEGEN_FRAMEINFO_H
14 #define LLVM_CODEGEN_FRAMEINFO_H
15
16 #include "Support/NonCopyable.h"
17 #include <vector>
18
19
20 //************************* Forward Declarations **************************/
21
22 class MachineCodeForMethod;
23 class TargetMachine;
24
25
26 //*************************** External Classes ****************************/
27
28
29 class MachineFrameInfo : public NonCopyableV {
30 public:
31   const TargetMachine& target;
32   
33 public:
34   /*ctor*/ MachineFrameInfo(const TargetMachine& tgt) : target(tgt) {}
35   
36   //
37   // These methods provide constant parameters of the frame layout.
38   // 
39   virtual int  getStackFrameSizeAlignment       () const = 0;
40   virtual int  getMinStackFrameSize             () const = 0;
41   virtual int  getNumFixedOutgoingArgs          () const = 0;
42   virtual int  getSizeOfEachArgOnStack          () const = 0;
43   virtual bool argsOnStackHaveFixedSize         () const = 0;
44   
45   //
46   // These methods compute offsets using the frame contents for a
47   // particular method.  The frame contents are obtained from the
48   // MachineCodeInfoForMethod object for the given method.
49   // The first few methods have default machine-independent implementations.
50   // The rest must be implemented by the machine-specific subclass.
51   // 
52   virtual int getIncomingArgOffset              (MachineCodeForMethod& mcInfo,
53                                                  unsigned argNum) const;
54   virtual int getOutgoingArgOffset              (MachineCodeForMethod& mcInfo,
55                                                  unsigned argNum) const;
56   
57   virtual int getFirstIncomingArgOffset         (MachineCodeForMethod& mcInfo,
58                                                  bool& growUp) const=0;
59   virtual int getFirstOutgoingArgOffset         (MachineCodeForMethod& mcInfo,
60                                                  bool& growUp) const=0;
61   virtual int getFirstOptionalOutgoingArgOffset (MachineCodeForMethod&,
62                                                  bool& growUp) const=0;
63   virtual int getFirstAutomaticVarOffset        (MachineCodeForMethod& mcInfo,
64                                                  bool& growUp) const=0;
65   virtual int getRegSpillAreaOffset             (MachineCodeForMethod& mcInfo,
66                                                  bool& growUp) const=0;
67   virtual int getTmpAreaOffset                  (MachineCodeForMethod& mcInfo,
68                                                  bool& growUp) const=0;
69   virtual int getDynamicAreaOffset              (MachineCodeForMethod& mcInfo,
70                                                  bool& growUp) const=0;
71
72   //
73   // These methods specify the base register used for each stack area
74   // (generally FP or SP)
75   // 
76   virtual int getIncomingArgBaseRegNum()               const=0;
77   virtual int getOutgoingArgBaseRegNum()               const=0;
78   virtual int getOptionalOutgoingArgBaseRegNum()       const=0;
79   virtual int getAutomaticVarBaseRegNum()              const=0;
80   virtual int getRegSpillAreaBaseRegNum()              const=0;
81   virtual int getDynamicAreaBaseRegNum()               const=0;
82 };
83
84 #endif