[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
This commit is contained in:
Wouter van Oortmerssen 2020-05-15 10:09:36 -07:00
parent 2c81508728
commit 62efd1eca2
1 changed files with 1 additions and 1 deletions

View File

@ -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());
}