diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2020-04-16 10:24:47 +0100 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2020-04-16 10:26:47 +0100 |
commit | c8d6fa5134ae66f3fb8e0b8caac5de4f737c8bef (patch) | |
tree | 5114ad7031338f68f33d14219a22c287f9b8eb97 /llvm/lib/CodeGen/LiveDebugValues.cpp | |
parent | 7b9c6c16c33deb52e7081f94ad51e3910ca592c9 (diff) | |
download | llvm-c8d6fa5134ae66f3fb8e0b8caac5de4f737c8bef.zip llvm-c8d6fa5134ae66f3fb8e0b8caac5de4f737c8bef.tar.gz llvm-c8d6fa5134ae66f3fb8e0b8caac5de4f737c8bef.tar.bz2 |
[LiveDebugValues] Terminate open ranges on DBG_VALUE $noreg
In D68209, LiveDebugValues::transferDebugValue had a call to
OpenRanges.erase shifted, and by accident this led to a code path where
DBG_VALUEs of $noreg would not have their open range terminated, allowing
variable locations to extend past blocks where they were terminated.
This patch correctly terminates the open range, if present, when such a
DBG_VAUE is encountered, and adds a test for this behaviour.
Differential Revision: https://reviews.llvm.org/D78218
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp index 530da52..fdea702 100644 --- a/llvm/lib/CodeGen/LiveDebugValues.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues.cpp @@ -968,9 +968,11 @@ void LiveDebugValues::transferDebugValue(const MachineInstr &MI, } else if (MI.hasOneMemOperand()) { llvm_unreachable("DBG_VALUE with mem operand encountered after regalloc?"); } else { - // This must be an undefined location. We should leave OpenRanges closed. + // This must be an undefined location. If it has an open range, erase it. assert(MI.getOperand(0).isReg() && MI.getOperand(0).getReg() == 0 && "Unexpected non-undef DBG_VALUE encountered"); + VarLoc VL(MI, LS); + OpenRanges.erase(VL); } } |