diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-16 15:57:43 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-16 15:57:43 +0000 |
commit | aa500f3f4307cf24f4775fa2c28870ff0a45bcaf (patch) | |
tree | f1d288875370a6c724030b26aaea532ac603db35 /include/llvm/Target/TargetFrameInfo.h | |
parent | e102a64beb3d9a5076d8b5d8aea4604e6b86751a (diff) | |
download | external_llvm-aa500f3f4307cf24f4775fa2c28870ff0a45bcaf.zip external_llvm-aa500f3f4307cf24f4775fa2c28870ff0a45bcaf.tar.gz external_llvm-aa500f3f4307cf24f4775fa2c28870ff0a45bcaf.tar.bz2 |
Add method adjustAlignment so that stack slot alignments can be computed
in a target-dependent manner (because of the dang OFFSET in Sparc v9).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetFrameInfo.h')
-rw-r--r-- | include/llvm/Target/TargetFrameInfo.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/llvm/Target/TargetFrameInfo.h b/include/llvm/Target/TargetFrameInfo.h index 659955c..c6d2a94 100644 --- a/include/llvm/Target/TargetFrameInfo.h +++ b/include/llvm/Target/TargetFrameInfo.h @@ -19,7 +19,6 @@ struct MachineFrameInfo : public NonCopyableV { public: MachineFrameInfo(const TargetMachine& tgt) : target(tgt) {} - // // These methods provide constant parameters of the frame layout. // virtual int getStackFrameSizeAlignment () const = 0; @@ -27,8 +26,15 @@ public: virtual int getNumFixedOutgoingArgs () const = 0; virtual int getSizeOfEachArgOnStack () const = 0; virtual bool argsOnStackHaveFixedSize () const = 0; - - // + + // This method adjusts a stack offset to meet alignment rules of target. + // + virtual int adjustAlignment (int unalignedOffset, + bool growUp, + unsigned int align) const { + return unalignedOffset + (growUp? +1:-1)*(unalignedOffset % align); + } + // 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. |