From 4bc5e389600f8c6f03e7b37e105d8ea9a02cb583 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 13 Jan 2011 21:28:52 +0000 Subject: Teach frame lowering to ignore debug values after the terminators. llvm-svn: 123399 --- llvm/lib/Target/CellSPU/SPUFrameLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Target/CellSPU/SPUFrameLowering.cpp') diff --git a/llvm/lib/Target/CellSPU/SPUFrameLowering.cpp b/llvm/lib/Target/CellSPU/SPUFrameLowering.cpp index 596d39c4417..432f4a1b59e 100644 --- a/llvm/lib/Target/CellSPU/SPUFrameLowering.cpp +++ b/llvm/lib/Target/CellSPU/SPUFrameLowering.cpp @@ -187,7 +187,7 @@ void SPUFrameLowering::emitPrologue(MachineFunction &MF) const { // sufficient number instructions in the basic block. Note that // this is just a best guess based on the basic block's size. if (MBB.size() >= (unsigned) SPUFrameLowering::branchHintPenalty()) { - MachineBasicBlock::iterator MBBI = prior(MBB.end()); + MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); dl = MBBI->getDebugLoc(); // Insert terminator label @@ -199,7 +199,7 @@ void SPUFrameLowering::emitPrologue(MachineFunction &MF) const { void SPUFrameLowering::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { - MachineBasicBlock::iterator MBBI = prior(MBB.end()); + MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); const SPUInstrInfo &TII = *static_cast(MF.getTarget().getInstrInfo()); const MachineFrameInfo *MFI = MF.getFrameInfo(); -- cgit v1.2.3