diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-05-16 03:17:16 -0700 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2021-05-17 13:47:36 -0700 |
commit | 6e1c1dac4c72cc57f4cd2bc8554e8ac9f2f50b6e (patch) | |
tree | 232d3e4a00e9e707bc9f3bc46ecd0390ae8cca52 /llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp | |
parent | e2e1a78abcefb396ea1c08990f4cf20ae5068ef8 (diff) | |
download | llvm-6e1c1dac4c72cc57f4cd2bc8554e8ac9f2f50b6e.zip llvm-6e1c1dac4c72cc57f4cd2bc8554e8ac9f2f50b6e.tar.gz llvm-6e1c1dac4c72cc57f4cd2bc8554e8ac9f2f50b6e.tar.bz2 |
[WebAssembly] Nullify DBG_VALUE_LISTs in DebugValueManager
WebAssemblyDebugValueManager class currently does not handle
DBG_VALUE_LIST instructions correctly for two reasons, which are
explained in https://bugs.llvm.org/show_bug.cgi?id=50361.
This effectively nullifies DBG_VALUE_LISTs in
WebAssemblyDebugValueManager so that the info will appear as "optimized
out" in debuggers but still be at least correct in the meantime.
Reviewed By: dschuff, jmorse
Differential Revision: https://reviews.llvm.org/D102589
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp index 7ed224d..9bea203 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp @@ -305,12 +305,11 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { if (!MFI.isVRegStackified(OldReg)) { const TargetRegisterClass *RC = MRI.getRegClass(OldReg); Register NewReg = MRI.createVirtualRegister(RC); - auto InsertPt = std::next(MI.getIterator()); if (UseEmpty[Register::virtReg2Index(OldReg)]) { unsigned Opc = getDropOpcode(RC); - MachineInstr *Drop = - BuildMI(MBB, InsertPt, MI.getDebugLoc(), TII->get(Opc)) - .addReg(NewReg); + MachineInstr *Drop = BuildMI(MBB, std::next(MI.getIterator()), + MI.getDebugLoc(), TII->get(Opc)) + .addReg(NewReg); // After the drop instruction, this reg operand will not be used Drop->getOperand(0).setIsKill(); if (MFI.isFrameBaseVirtual() && OldReg == MFI.getFrameBaseVreg()) @@ -321,7 +320,8 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { WebAssemblyDebugValueManager(&MI).replaceWithLocal(LocalId); - BuildMI(MBB, InsertPt, MI.getDebugLoc(), TII->get(Opc)) + BuildMI(MBB, std::next(MI.getIterator()), MI.getDebugLoc(), + TII->get(Opc)) .addImm(LocalId) .addReg(NewReg); } |