[PATCH] D115749: [WebAssembly] Emit symbol labels for table global symbols
Paulo Matos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 11 08:34:43 PST 2022
pmatos added inline comments.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:202
+ // If the GlobalVariable refers to a table, we handle it here instead of
+ // in emitExternalDecls
+ if (Sym->isTable())
----------------
sbc100 wrote:
> Are you saying that for undefined/external tables we call `emitTableType` elsewhere? IIUC the table type needs to be declared ragardless of whether the table has a definition (hasInitializer()) or not, right?
>
> This comment seems a little odd to me given that the code below doesn't just handle table symbols.
Yes, so if the table is extern it's `tabletype` is emitted in `emitExternDecls`. If it's a global defined in the current compilation unit, then it needs to be emitted here. That's what I was trying to say with my comment, but maybe I need to be more precise.
Regarding the mention of `hasInitializer()`, I am unsure how to actually test this. I haven't managed to create a table as a global that doesn't enter the condition, i.e. without an initializer. Do you have a suggestion?
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