From 62efd1eca2011258f6e784d529c076770a76f3a6 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Fri, 15 May 2020 10:09:36 -0700 Subject: [PATCH] [WebAssembly] Fixed debugloc in DebugFixup pass BuildMI requires this debug loc to be from the same sub program as the variable metadata passed in. Differential Revision: https://reviews.llvm.org/D80019 --- llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp index 3b08443..8f1f77e 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp @@ -118,7 +118,7 @@ bool WebAssemblyDebugFixup::runOnMachineFunction(MachineFunction &MF) { // a $noreg DBG_VALUE for the variable to end it, right after // the current instruction. BuildMI(*Prev.DebugValue->getParent(), std::next(MII), - MI.getDebugLoc(), TII->get(WebAssembly::DBG_VALUE), false, + Prev.DebugValue->getDebugLoc(), TII->get(WebAssembly::DBG_VALUE), false, Register(), Prev.DebugValue->getOperand(2).getMetadata(), Prev.DebugValue->getOperand(3).getMetadata()); } -- 2.7.4