aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorScott Linder <scott.linder@amd.com>2025-09-18 10:47:07 -0400
committerGitHub <noreply@github.com>2025-09-18 10:47:07 -0400
commitad68e5d56c0258cf6c20657bebc9ef0ad5b20551 (patch)
tree47fe55d77dd892dc5e899eb0430a026228ceb878 /llvm/lib/CodeGen/LiveDebugVariables.cpp
parent902ddda120a55789f761165442a375ca6c916752 (diff)
downloadllvm-ad68e5d56c0258cf6c20657bebc9ef0ad5b20551.zip
llvm-ad68e5d56c0258cf6c20657bebc9ef0ad5b20551.tar.gz
llvm-ad68e5d56c0258cf6c20657bebc9ef0ad5b20551.tar.bz2
[LiveDebugVariables] Use bundle-aware iterators consistently (#159471)
Most of the pass works in terms of MachineBasicBlock::iterator (MachineInstrBundleIterator), but here one is constructed from an arbitrary instruction which may be within a bundle, causing an assertion.
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index b049491..001ba52 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -1973,8 +1973,8 @@ void LiveDebugVariables::LDVImpl::emitDebugValues(VirtRegMap *VRM) {
if (MachineInstr *Pos = Slots->getInstructionFromIndex(Idx)) {
// Insert at the end of any debug instructions.
- auto PostDebug = std::next(Pos->getIterator());
- PostDebug = skipDebugInstructionsForward(PostDebug, MBB->instr_end());
+ auto PostDebug = std::next(MachineBasicBlock::iterator(Pos));
+ PostDebug = skipDebugInstructionsForward(PostDebug, MBB->end());
EmitInstsHere(PostDebug);
} else {
// Insert position disappeared; walk forwards through slots until we