[PATCH] D115749: [WebAssembly] Emit symbol labels for table global symbols

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 24 06:38:53 PST 2022


pmatos added a comment.

Refactored the setting of the Wasm Symbol type into `WasmSymbolSetType` in `WebAssemblyAsmPrinter.cpp` and `WebAssemblyMCInstLower.cpp`. However, this forced us to move the function to `WebAssemblyTypeUtilities.h` and refactor some other type-related functions from `WebAssemblyUtilities` to `WebAssemblyTypeUtilities`.

This allowed us to simplify the `emitLinkage` implementation by removing the overridden function and moving the call of `emitExternalDecls` to `emitConstantPool`, which is the first function to be called when a function header is emitted.

So now we can write something like `table-types.ll`, which before didn't work at all because global symbols like tables where not being emitted besides the first one. Also declared only tables where not being emitted but now they are. After the clarification between .tabletype, .globl and label, I feel like this ensures the right directives are correctly emitted. The different combinations are checked through `table-types.ll`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115749



More information about the llvm-commits mailing list