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 | c036181790b81f9efd806e8b7f37be6af4628a4a (patch) | |
tree | 7acb11187b1a550cfa710de0d48dd9362fc10814 /lib/Target/CellSPU | |
parent | 78c70a063ae08cf2bae5a8316cb607ceb57defad (diff) | |
download | external_llvm-c036181790b81f9efd806e8b7f37be6af4628a4a.zip external_llvm-c036181790b81f9efd806e8b7f37be6af4628a4a.tar.gz external_llvm-c036181790b81f9efd806e8b7f37be6af4628a4a.tar.bz2 |
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')
-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 64ed828..e031048 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"); |