aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2021-10-25 14:00:42 -0700
committerWouter van Oortmerssen <aardappel@gmail.com>2021-10-28 12:35:46 -0700
commita66451ebbe450a5e9dc6baf0c4e9f5738df589a2 (patch)
tree1f822829149efc09eadd56a1808d5108dedc1883 /llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
parentf7f430c9136330545637aaddebf013da05c0f370 (diff)
downloadllvm-a66451ebbe450a5e9dc6baf0c4e9f5738df589a2.zip
llvm-a66451ebbe450a5e9dc6baf0c4e9f5738df589a2.tar.gz
llvm-a66451ebbe450a5e9dc6baf0c4e9f5738df589a2.tar.bz2
[WebAssembly] Fix debug locations for ExplicitLocals pass
Differential Revision: https://reviews.llvm.org/D112487
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
index a933d1a..da8b742 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
@@ -379,8 +379,13 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) {
const TargetRegisterClass *RC = MRI.getRegClass(OldReg);
Register NewReg = MRI.createVirtualRegister(RC);
unsigned Opc = getLocalGetOpcode(RC);
+ // Use a blank DebugLoc, because InsertPt may be discontinuous from
+ // the usage of this value, causing non-linear stepping in the
+ // debugger or function entry points where variables aren't live yet.
+ // See crbug.com/1251909, crbug.com/1249745
+ DebugLoc DL;
InsertPt =
- BuildMI(MBB, InsertPt, MI.getDebugLoc(), TII->get(Opc), NewReg)
+ BuildMI(MBB, InsertPt, DL, TII->get(Opc), NewReg)
.addImm(LocalId);
MO.setReg(NewReg);
MFI.stackifyVReg(MRI, NewReg);