aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 822a1be..2ff346d 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -1625,8 +1625,9 @@ findInsertLocation(MachineBasicBlock *MBB, SlotIndex Idx, LiveIntervals &LIS,
}
// Don't insert anything after the first terminator, though.
- return MI->isTerminator() ? MBB->getFirstTerminator() :
- std::next(MachineBasicBlock::iterator(MI));
+ auto It = MI->isTerminator() ? MBB->getFirstTerminator()
+ : std::next(MachineBasicBlock::iterator(MI));
+ return skipDebugInstructionsForward(It, MBB->end());
}
/// Find an iterator for inserting the next DBG_VALUE instruction