mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Better terminator avoidance.
This approach also works when the terminator doesn't have a slot index. (Which can happen??) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8fbbd1c03d
commit
eea666f216
@ -589,14 +589,6 @@ 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() && !LIS.isNotInMIMap(Term) &&
|
||||
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))) {
|
||||
@ -611,7 +603,9 @@ findInsertLocation(MachineBasicBlock *MBB, SlotIndex Idx, DebugLoc &DL,
|
||||
}
|
||||
// We found an instruction. The insert point is after the instr.
|
||||
DL = MI->getDebugLoc();
|
||||
return llvm::next(MachineBasicBlock::iterator(MI));
|
||||
// Don't insert anything after the first terminator, though.
|
||||
return MI->getDesc().isTerminator() ? MBB->getFirstTerminator() :
|
||||
llvm::next(MachineBasicBlock::iterator(MI));
|
||||
}
|
||||
|
||||
void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex Idx,
|
||||
|
Loading…
Reference in New Issue
Block a user