diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-02-23 00:42:30 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-02-23 00:42:30 +0000 |
commit | 9ee052bcdcf50e0a3a5745bd2d479899d81bd9f3 (patch) | |
tree | 93b7f1baba9df0955abdf78dedd60eafd7b17b1d /llvm/lib/Target/ARM/ARMRegisterInfo.cpp | |
parent | 9d31aca6797482d7ee443eed5ebacd0c72e02939 (diff) | |
download | llvm-9ee052bcdcf50e0a3a5745bd2d479899d81bd9f3.zip llvm-9ee052bcdcf50e0a3a5745bd2d479899d81bd9f3.tar.gz llvm-9ee052bcdcf50e0a3a5745bd2d479899d81bd9f3.tar.bz2 |
Propagate debug loc info through prologue/epilogue.
llvm-svn: 65298
Diffstat (limited to 'llvm/lib/Target/ARM/ARMRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMRegisterInfo.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMRegisterInfo.cpp index bd95a48..8785c39 100644 --- a/llvm/lib/Target/ARM/ARMRegisterInfo.cpp +++ b/llvm/lib/Target/ARM/ARMRegisterInfo.cpp @@ -1222,7 +1222,8 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const { unsigned VARegSaveSize = AFI->getVarArgsRegSaveSize(); unsigned NumBytes = MFI->getStackSize(); const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo(); - DebugLoc dl = DebugLoc::getUnknownLoc(); + DebugLoc dl = (MBBI != MBB.end() ? + MBBI->getDebugLoc() : DebugLoc::getUnknownLoc()); if (isThumb) { // Check if R3 is live in. It might have to be used as a scratch register. @@ -1292,8 +1293,11 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const { // Build the new SUBri to adjust SP for integer callee-save spill area 1. emitSPUpdate(MBB, MBBI, -GPRCS1Size, ARMCC::AL, 0, isThumb, TII, *this, dl); movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, 1, STI); - } else if (MBBI != MBB.end() && MBBI->getOpcode() == ARM::tPUSH) + } else if (MBBI != MBB.end() && MBBI->getOpcode() == ARM::tPUSH) { ++MBBI; + if (MBBI != MBB.end()) + dl = MBBI->getDebugLoc(); + } // Darwin ABI requires FP to point to the stack slot that contains the // previous FP. @@ -1358,18 +1362,18 @@ static bool isCSRestore(MachineInstr *MI, const unsigned *CSRegs) { void ARMRegisterInfo::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { - DebugLoc dl = DebugLoc::getUnknownLoc(); MachineBasicBlock::iterator MBBI = prior(MBB.end()); assert((MBBI->getOpcode() == ARM::BX_RET || MBBI->getOpcode() == ARM::tBX_RET || MBBI->getOpcode() == ARM::tPOP_RET) && "Can only insert epilog into returning blocks"); - + DebugLoc dl = MBBI->getDebugLoc(); MachineFrameInfo *MFI = MF.getFrameInfo(); ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); bool isThumb = AFI->isThumbFunction(); unsigned VARegSaveSize = AFI->getVarArgsRegSaveSize(); int NumBytes = (int)MFI->getStackSize(); + if (!AFI->hasStackFrame()) { if (NumBytes != 0) emitSPUpdate(MBB, MBBI, NumBytes, ARMCC::AL, 0, isThumb, TII, *this, dl); |