mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
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
This commit is contained in:
parent
e102a64beb
commit
aa500f3f43
@ -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;
|
||||
@ -28,7 +27,14 @@ public:
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user