[PATCH] D91203: [WebAssembly] Fixed wasm64 DWARF using 64-bit code pointer sizes

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 09:11:20 PST 2020


aardappel added a comment.

@yurydelendik note that `wasm64` is an LLVM-level construct, in general Wasm we may one day have multiple memories, which means that "being 64-bit" is a property of each load/store instruction individually. So assuming we have a DWARF section associated with a possibly mixed mode Wasm module, there's no way to determine the size of `DW_AT_low_pc` or `DW_FORM_addr` from the module.

Granted, this is a little hypothetical, since we don't know if `wasm-ld` will ever support such mixed linking (or another linker will), or wether DWARF will be output by non-LLVM producers, but the fact remains that Wasm really doesn't have an "architecture" in the same way as other ISAs.

Thus, it seems easier to me to hard-code `DW_FORM_addr` to always be 32 or 64-bit for Wasm. Either choice is going to give the problem this patch is trying to address, though.

@dblaikie As @sbc100 indicated, this particular value is purely for use by DWARF, and has no relation to any other values in the Wasm ecosystem. So I am not sure there is a comparable situation in another target. The question remains thus how to plumb this to `DIEInteger::SizeOf`, and if indeed this is so exceptional, maybe a direct check against the Wasm triple there is better than trying to make the concept of "code pointer" generic for other architectures.


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

https://reviews.llvm.org/D91203



More information about the llvm-commits mailing list