mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
fix the loading of the link register in emitepilogue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dcffb0cf81
commit
2c8cdc6c1a
@ -129,6 +129,8 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
// entry to the current function. This eliminates the need for add/sub
|
||||
// brackets around call sites.
|
||||
NumBytes += MFI->getMaxCallFrameSize();
|
||||
} else {
|
||||
NumBytes += 4;
|
||||
}
|
||||
|
||||
MFI->setStackSize(NumBytes);
|
||||
@ -149,7 +151,7 @@ void ARMRegisterInfo::emitEpilogue(MachineFunction &MF,
|
||||
int NumBytes = (int) MFI->getStackSize();
|
||||
|
||||
//ldr lr, [sp]
|
||||
BuildMI(MBB, MBBI, ARM::ldr, 2, ARM::R14).addImm(0).addReg(ARM::R13);
|
||||
BuildMI(MBB, MBBI, ARM::ldr, 2, ARM::R14).addImm(NumBytes - 4).addReg(ARM::R13);
|
||||
//add sp, sp, #NumBytes
|
||||
BuildMI(MBB, MBBI, ARM::addri, 2, ARM::R13).addReg(ARM::R13).addImm(NumBytes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user