[PATCH] D74781: Wasm-ld emits invalid .debug_ranges entries for non-live symbols

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 12:21:24 PDT 2020


dblaikie added a comment.

In D74781#1938336 <https://reviews.llvm.org/D74781#1938336>, @paolosev wrote:

> @sbc100  Adding a test.
>
> @dblaikie Strangely, I can't find a way to generate a **.debug_loc** section for Wasm.


Maybe it's not applicable to wasm, I don't know much about it - but if it optimizes variables into registers (or out of them), then it shuold be producible.

Here's a simple test case I use for debug_loc in C++ on a silicon target:

  void f1();
  int main() {
    int i = 3;
    f1();
    i = 7;
    f1();
  }

Compiled with optimizations enabled, the storage for 'i' will be eliminated and a DWARF location list will be used to describe 'i' as having the value 3 over the first call instruction, and the value 7 over the second call instruction.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74781/new/

https://reviews.llvm.org/D74781





More information about the llvm-commits mailing list