diff options
author | Evgeny Leviant <eleviant@accesssoftek.com> | 2021-09-08 14:06:08 +0300 |
---|---|---|
committer | Evgeny Leviant <eleviant@accesssoftek.com> | 2021-09-08 14:06:08 +0300 |
commit | 93b09a2a5d787beda3252a8c2662d19a44527881 (patch) | |
tree | 43183514db980db43534e08abae1b36a2e74b41d /llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | |
parent | 98380762c3b734c23d206182605ab9e035c93caa (diff) | |
download | llvm-93b09a2a5d787beda3252a8c2662d19a44527881.zip llvm-93b09a2a5d787beda3252a8c2662d19a44527881.tar.gz llvm-93b09a2a5d787beda3252a8c2662d19a44527881.tar.bz2 |
[LiveDebugValues] Handle spills of indirect debug values correctly
When handling register spill for indirect debug value LiveDebugValues pass doesn't add
DW_OP_deref operator which may in some cases cause debugger to return value address, instead
of value while machine register holding that address is spilled.
Differential revision: https://reviews.llvm.org/D109142
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp index 2566907..99a57b5 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp @@ -556,9 +556,10 @@ private: unsigned Base = Loc.SpillLocation.SpillBase; auto *TRI = MF.getSubtarget().getRegisterInfo(); if (MI.isNonListDebugValue()) { - DIExpr = - TRI->prependOffsetExpression(DIExpr, DIExpression::ApplyOffset, - Loc.SpillLocation.SpillOffset); + auto Deref = Indirect ? DIExpression::DerefAfter : 0; + DIExpr = TRI->prependOffsetExpression( + DIExpr, DIExpression::ApplyOffset | Deref, + Loc.SpillLocation.SpillOffset); Indirect = true; } else { SmallVector<uint64_t, 4> Ops; |