diff options
author | stozer <stephen.tozer@sony.com> | 2020-06-22 16:01:12 +0100 |
---|---|---|
committer | stozer <stephen.tozer@sony.com> | 2020-06-22 16:01:12 +0100 |
commit | 539381da26096df54ccf862088c8242498a7dcae (patch) | |
tree | d900f6b3513c227d8f5fd572b390705bb2f4ea0c /llvm/lib/CodeGen/MachineRegisterInfo.cpp | |
parent | 597a9070b52d235fac40ef55b9d16bf77d8f4dd7 (diff) | |
download | llvm-539381da26096df54ccf862088c8242498a7dcae.zip llvm-539381da26096df54ccf862088c8242498a7dcae.tar.gz llvm-539381da26096df54ccf862088c8242498a7dcae.tar.bz2 |
[DebugInfo] Update MachineInstr to help support variadic DBG_VALUE instructions
Following on from this RFC[0] from a while back, this is the first patch towards
implementing variadic debug values.
This patch specifically adds a set of functions to MachineInstr for performing
operations specific to debug values, and replacing uses of the more general
functions where appropriate. The most prevalent of these is replacing
getOperand(0) with getDebugOperand(0) for debug-value-specific code, as the
operands corresponding to values will no longer be at index 0, but index 2 and
upwards: getDebugOperand(x) == getOperand(x+2). Similar replacements have been
added for the other operands, along with some helper functions to replace
oft-repeated code and operate on a variable number of value operands.
[0] http://lists.llvm.org/pipermail/llvm-dev/2020-February/139376.html<Paste>
Differential Revision: https://reviews.llvm.org/D81852
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineRegisterInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp index f627f58..4c733738 100644 --- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp +++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp @@ -550,7 +550,7 @@ void MachineRegisterInfo::markUsesInDebugValueAsUndef(Register Reg) const { nextI = std::next(I); // I is invalidated by the setReg MachineInstr *UseMI = &*I; if (UseMI->isDebugValue()) - UseMI->getOperand(0).setReg(0U); + UseMI->getDebugOperandForReg(Reg)->setReg(0U); } } |