mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
fix Allocas. Really. I mean it this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20306 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -220,7 +220,8 @@ void AlphaRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
|||||||
// brackets around call sites.
|
// brackets around call sites.
|
||||||
//If there is a frame pointer, then we don't do this
|
//If there is a frame pointer, then we don't do this
|
||||||
NumBytes += MFI->getMaxCallFrameSize();
|
NumBytes += MFI->getMaxCallFrameSize();
|
||||||
std::cerr << "Added " << MFI->getMaxCallFrameSize() << " to the stack due to calls\n";
|
DEBUG(std::cerr << "Added " << MFI->getMaxCallFrameSize()
|
||||||
|
<< " to the stack due to calls\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FP)
|
if (FP)
|
||||||
@ -274,6 +275,10 @@ void AlphaRegisterInfo::emitEpilogue(MachineFunction &MF,
|
|||||||
//now if we need to, restore the old FP
|
//now if we need to, restore the old FP
|
||||||
if (FP)
|
if (FP)
|
||||||
{
|
{
|
||||||
|
//copy the FP into the SP (discards allocas)
|
||||||
|
MI=BuildMI(Alpha::BIS, 2, Alpha::R30).addReg(Alpha::R15).addReg(Alpha::R15);
|
||||||
|
MBB.insert(MBBI, MI);
|
||||||
|
//restore the FP
|
||||||
MI=BuildMI(Alpha::LDQ, 2, Alpha::R15).addImm(0).addReg(Alpha::R15);
|
MI=BuildMI(Alpha::LDQ, 2, Alpha::R15).addImm(0).addReg(Alpha::R15);
|
||||||
MBB.insert(MBBI, MI);
|
MBB.insert(MBBI, MI);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user