mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Don't insert DBG_VALUE instructions after the first terminator.
For one, MachineBasicBlock::getFirstTerminator() doesn't understand what is happening, and it also makes sense to have all control flow run through the DBG_VALUE. llvm-svn: 123277
This commit is contained in:
parent
05ef00f4dc
commit
1cd577b435
@ -587,6 +587,13 @@ findInsertLocation(MachineBasicBlock *MBB, SlotIndex Idx, DebugLoc &DL,
|
||||
SlotIndex Start = LIS.getMBBStartIdx(MBB);
|
||||
Idx = Idx.getBaseIndex();
|
||||
|
||||
// Don't insert anything after the first terminator.
|
||||
MachineBasicBlock::iterator Term = MBB->getFirstTerminator();
|
||||
if (Term != MBB->end() && Idx >= LIS.getInstructionIndex(Term)) {
|
||||
DL = Term->getDebugLoc();
|
||||
return Term;
|
||||
}
|
||||
|
||||
// Try to find an insert location by going backwards from Idx.
|
||||
MachineInstr *MI;
|
||||
while (!(MI = LIS.getInstructionFromIndex(Idx))) {
|
||||
|
Loading…
Reference in New Issue
Block a user