diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-08 04:52:27 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-08 04:52:27 +0000 |
commit | 7cffcaaa48656fa6f90b041cc5f056304addef32 (patch) | |
tree | 896eb2fd896ce5834127dd5de15beb3b10ee089e /include | |
parent | df2ee6cff2d13abcc46e1670d0867b9b10e60d97 (diff) | |
download | external_llvm-7cffcaaa48656fa6f90b041cc5f056304addef32.zip external_llvm-7cffcaaa48656fa6f90b041cc5f056304addef32.tar.gz external_llvm-7cffcaaa48656fa6f90b041cc5f056304addef32.tar.bz2 |
Machine-independent interface to target's stack frame layout parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetFrameInfo.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetFrameInfo.h b/include/llvm/Target/TargetFrameInfo.h new file mode 100644 index 0000000..4f19cc9 --- /dev/null +++ b/include/llvm/Target/TargetFrameInfo.h @@ -0,0 +1,76 @@ +// $Id$ -*-c++-*- +//*************************************************************************** +// File: +// MachineFrameInfo.h +// +// Purpose: +// Interface to layout of stack frame on target machine. +// +// History: +// 11/6/01 - Vikram Adve - Created +//**************************************************************************/ + +#ifndef LLVM_CODEGEN_FRAMEINFO_H +#define LLVM_CODEGEN_FRAMEINFO_H + +#include "llvm/Support/NonCopyable.h" +#include <vector> + + +//************************* Forward Declarations **************************/ + +class MachineCodeForMethod; + + +//*************************** External Classes ****************************/ + + +class MachineFrameInfo : public NonCopyableV { +public: + const TargetMachine& target; + +public: + /*ctor*/ MachineFrameInfo(const TargetMachine& tgt) : target(tgt) {} + + // + // 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. + // + virtual int getFirstIncomingArgOffset (MachineCodeForMethod& mcInfo, + bool& pos) const=0; + virtual int getFirstOutgoingArgOffset (MachineCodeForMethod& mcInfo, + bool& pos) const=0; + virtual int getFirstOptionalOutgoingArgOffset (MachineCodeForMethod&, + bool& pos) const=0; + virtual int getFirstAutomaticVarOffset (MachineCodeForMethod& mcInfo, + bool& pos) const=0; + virtual int getRegSpillAreaOffset (MachineCodeForMethod& mcInfo, + bool& pos) const=0; + virtual int getTmpAreaOffset (MachineCodeForMethod& mcInfo, + bool& pos) const=0; + virtual int getDynamicAreaOffset (MachineCodeForMethod& mcInfo, + bool& pos) const=0; + + // + // 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 |