[WebAssembly] Handle DebugLoc in DebugValueManager
authorHeejin Ahn <aheejin@gmail.com>
Mon, 27 Mar 2023 03:52:22 +0000 (20:52 -0700)
committerHeejin Ahn <aheejin@gmail.com>
Thu, 13 Apr 2023 06:47:24 +0000 (23:47 -0700)
commitd20a1b87f689a716e16477b8562fd820a72a6a8b
tree527393325009385605d8ef657a48524a5e3ffba8
parent7d7b178d752a9af023714ff3ae0c268d596932e1
[WebAssembly] Handle DebugLoc in DebugValueManager

According to
https://llvm.org/docs/HowToUpdateDebugInfo.html#when-to-preserve-an-instruction-location,
when moving (and in our case cloning) within the same BB, the debug
location is preserved. But when moving / cloning to a different BB, we
preserve the debug location only if the destination BB contains the same
location. Currently we preserve the debug loc unconditionally in all
cases. This CL correctly handles the debug locs in DebugValueManager.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D148115
llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.cpp
llvm/test/DebugInfo/WebAssembly/dbg-loc-reg-stackify.mir [new file with mode: 0644]