mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Don't pad spills and temp. stack areas for alignment.
Freeze auto vars and spill areas when their sizes are used for computing other offsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31f78c4f6b
commit
0bc0516078
@ -57,10 +57,10 @@ int
|
||||
UltraSparcFrameInfo::getRegSpillAreaOffset(MachineCodeForMethod& mcInfo,
|
||||
bool& pos) const
|
||||
{
|
||||
mcInfo.freezeAutomaticVarsArea(); // ensure no more auto vars are added
|
||||
|
||||
pos = false; // static stack area grows downwards
|
||||
unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize();
|
||||
if (int mod = autoVarsSize % getStackFrameSizeAlignment())
|
||||
autoVarsSize += (getStackFrameSizeAlignment() - mod);
|
||||
return StaticAreaOffsetFromFP - autoVarsSize;
|
||||
}
|
||||
|
||||
@ -68,12 +68,13 @@ int
|
||||
UltraSparcFrameInfo::getTmpAreaOffset(MachineCodeForMethod& mcInfo,
|
||||
bool& pos) const
|
||||
{
|
||||
mcInfo.freezeAutomaticVarsArea(); // ensure no more auto vars are added
|
||||
mcInfo.freezeSpillsArea(); // ensure no more spill slots are added
|
||||
|
||||
pos = false; // static stack area grows downwards
|
||||
unsigned int autoVarsSize = mcInfo.getAutomaticVarsSize();
|
||||
unsigned int spillAreaSize = mcInfo.getRegSpillsSize();
|
||||
int offset = autoVarsSize + spillAreaSize;
|
||||
if (int mod = offset % getStackFrameSizeAlignment())
|
||||
offset += (getStackFrameSizeAlignment() - mod);
|
||||
return StaticAreaOffsetFromFP - offset;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user