2002-08-09 20:08:06 +00:00
|
|
|
//===-- llvm/CodeGen/MachineFrameInfo.h -------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// Interface to layout of stack frame on target machine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2001-11-08 04:52:27 +00:00
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_FRAMEINFO_H
|
|
|
|
#define LLVM_CODEGEN_FRAMEINFO_H
|
|
|
|
|
2001-11-27 00:03:19 +00:00
|
|
|
#include "Support/NonCopyable.h"
|
2001-11-08 04:52:27 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class MachineCodeForMethod;
|
2002-04-25 04:48:54 +00:00
|
|
|
class TargetMachine;
|
2001-11-08 04:52:27 +00:00
|
|
|
|
2002-08-09 20:08:06 +00:00
|
|
|
struct MachineFrameInfo : public NonCopyableV {
|
|
|
|
const TargetMachine ⌖
|
2001-11-08 04:52:27 +00:00
|
|
|
|
|
|
|
public:
|
2002-08-09 20:08:06 +00:00
|
|
|
MachineFrameInfo(const TargetMachine& tgt) : target(tgt) {}
|
2001-11-08 04:52:27 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// These methods provide constant parameters of the frame layout.
|
|
|
|
//
|
|
|
|
virtual int getStackFrameSizeAlignment () const = 0;
|
|
|
|
virtual int getMinStackFrameSize () const = 0;
|
|
|
|
virtual int getNumFixedOutgoingArgs () const = 0;
|
|
|
|
virtual int getSizeOfEachArgOnStack () const = 0;
|
|
|
|
virtual bool argsOnStackHaveFixedSize () const = 0;
|
|
|
|
|
|
|
|
//
|
|
|
|
// These methods compute offsets using the frame contents for a
|
|
|
|
// particular method. The frame contents are obtained from the
|
|
|
|
// MachineCodeInfoForMethod object for the given method.
|
2002-04-25 04:48:54 +00:00
|
|
|
// The first few methods have default machine-independent implementations.
|
|
|
|
// The rest must be implemented by the machine-specific subclass.
|
2001-11-08 04:52:27 +00:00
|
|
|
//
|
2002-04-25 04:48:54 +00:00
|
|
|
virtual int getIncomingArgOffset (MachineCodeForMethod& mcInfo,
|
|
|
|
unsigned argNum) const;
|
|
|
|
virtual int getOutgoingArgOffset (MachineCodeForMethod& mcInfo,
|
|
|
|
unsigned argNum) const;
|
|
|
|
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getFirstIncomingArgOffset (MachineCodeForMethod& mcInfo,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getFirstOutgoingArgOffset (MachineCodeForMethod& mcInfo,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getFirstOptionalOutgoingArgOffset (MachineCodeForMethod&,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getFirstAutomaticVarOffset (MachineCodeForMethod& mcInfo,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getRegSpillAreaOffset (MachineCodeForMethod& mcInfo,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getTmpAreaOffset (MachineCodeForMethod& mcInfo,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
virtual int getDynamicAreaOffset (MachineCodeForMethod& mcInfo,
|
2002-04-25 04:48:54 +00:00
|
|
|
bool& growUp) const=0;
|
2001-11-08 04:52:27 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// These methods specify the base register used for each stack area
|
|
|
|
// (generally FP or SP)
|
|
|
|
//
|
|
|
|
virtual int getIncomingArgBaseRegNum() const=0;
|
|
|
|
virtual int getOutgoingArgBaseRegNum() const=0;
|
|
|
|
virtual int getOptionalOutgoingArgBaseRegNum() const=0;
|
|
|
|
virtual int getAutomaticVarBaseRegNum() const=0;
|
|
|
|
virtual int getRegSpillAreaBaseRegNum() const=0;
|
|
|
|
virtual int getDynamicAreaBaseRegNum() const=0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|