1 //===-- llvm/CodeGen/MachineFrameInfo.h -------------------------*- C++ -*-===//
3 // Interface to layout of stack frame on target machine.
5 //===----------------------------------------------------------------------===//
7 #ifndef LLVM_CODEGEN_FRAMEINFO_H
8 #define LLVM_CODEGEN_FRAMEINFO_H
10 #include "Support/NonCopyable.h"
13 class MachineCodeForMethod;
16 struct MachineFrameInfo : public NonCopyableV {
17 const TargetMachine ⌖
20 MachineFrameInfo(const TargetMachine& tgt) : target(tgt) {}
23 // These methods provide constant parameters of the frame layout.
25 virtual int getStackFrameSizeAlignment () const = 0;
26 virtual int getMinStackFrameSize () const = 0;
27 virtual int getNumFixedOutgoingArgs () const = 0;
28 virtual int getSizeOfEachArgOnStack () const = 0;
29 virtual bool argsOnStackHaveFixedSize () const = 0;
32 // These methods compute offsets using the frame contents for a
33 // particular method. The frame contents are obtained from the
34 // MachineCodeInfoForMethod object for the given method.
35 // The first few methods have default machine-independent implementations.
36 // The rest must be implemented by the machine-specific subclass.
38 virtual int getIncomingArgOffset (MachineCodeForMethod& mcInfo,
39 unsigned argNum) const;
40 virtual int getOutgoingArgOffset (MachineCodeForMethod& mcInfo,
41 unsigned argNum) const;
43 virtual int getFirstIncomingArgOffset (MachineCodeForMethod& mcInfo,
44 bool& growUp) const=0;
45 virtual int getFirstOutgoingArgOffset (MachineCodeForMethod& mcInfo,
46 bool& growUp) const=0;
47 virtual int getFirstOptionalOutgoingArgOffset (MachineCodeForMethod&,
48 bool& growUp) const=0;
49 virtual int getFirstAutomaticVarOffset (MachineCodeForMethod& mcInfo,
50 bool& growUp) const=0;
51 virtual int getRegSpillAreaOffset (MachineCodeForMethod& mcInfo,
52 bool& growUp) const=0;
53 virtual int getTmpAreaOffset (MachineCodeForMethod& mcInfo,
54 bool& growUp) const=0;
55 virtual int getDynamicAreaOffset (MachineCodeForMethod& mcInfo,
56 bool& growUp) const=0;
59 // These methods specify the base register used for each stack area
60 // (generally FP or SP)
62 virtual int getIncomingArgBaseRegNum() const=0;
63 virtual int getOutgoingArgBaseRegNum() const=0;
64 virtual int getOptionalOutgoingArgBaseRegNum() const=0;
65 virtual int getAutomaticVarBaseRegNum() const=0;
66 virtual int getRegSpillAreaBaseRegNum() const=0;
67 virtual int getDynamicAreaBaseRegNum() const=0;