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 | ef4cfc749a61d0d0252196c957697436ba7ec068 (patch) | |
tree | 7acb11187b1a550cfa710de0d48dd9362fc10814 /lib/Target/CellSPU/SPURegisterInfo.cpp | |
parent | 4214a5531cdbe538a358033f1847e55c4436be1b (diff) | |
download | llvm-ef4cfc749a61d0d0252196c957697436ba7ec068.tar.gz llvm-ef4cfc749a61d0d0252196c957697436ba7ec068.tar.bz2 llvm-ef4cfc749a61d0d0252196c957697436ba7ec068.tar.xz |
Propagate debug loc info through prologue/epilogue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CellSPU/SPURegisterInfo.cpp')
-rw-r--r-- | lib/Target/CellSPU/SPURegisterInfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/CellSPU/SPURegisterInfo.cpp b/lib/Target/CellSPU/SPURegisterInfo.cpp index 64ed828797..e031048e7c 100644 --- a/lib/Target/CellSPU/SPURegisterInfo.cpp +++ b/lib/Target/CellSPU/SPURegisterInfo.cpp @@ -428,7 +428,8 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const MachineBasicBlock::iterator MBBI = MBB.begin(); MachineFrameInfo *MFI = MF.getFrameInfo(); MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - DebugLoc dl = DebugLoc::getUnknownLoc(); + DebugLoc dl = (MBBI != MBB.end() ? + MBBI->getDebugLoc() : DebugLoc::getUnknownLoc()); // Prepare for debug frame info. bool hasDebugInfo = MMI && MMI->hasDebugInfo(); @@ -521,6 +522,8 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const // this is just a best guess based on the basic block's size. if (MBB.size() >= (unsigned) SPUFrameInfo::branchHintPenalty()) { MachineBasicBlock::iterator MBBI = prior(MBB.end()); + dl = MBBI->getDebugLoc(); + // Insert terminator label unsigned BranchLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, dl, TII.get(SPU::DBG_LABEL)).addImm(BranchLabelId); @@ -535,7 +538,7 @@ SPURegisterInfo::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const const MachineFrameInfo *MFI = MF.getFrameInfo(); int FrameSize = MFI->getStackSize(); int LinkSlotOffset = SPUFrameInfo::stackSlotSize(); - DebugLoc dl = DebugLoc::getUnknownLoc(); + DebugLoc dl = MBBI->getDebugLoc(); assert(MBBI->getOpcode() == SPU::RET && "Can only insert epilog into returning blocks"); |