[PATCH] D115749: [WebAssembly] Emit symbol labels for table global symbols
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 15 08:12:00 PST 2021
sbc100 added inline comments.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:204
if (Sym->isTable()) {
+ OutStreamer->emitLabel(Sym);
getTargetStreamer()->emitTableType(Sym);
----------------
Are all symbols here defined? (As opposed to external?) Below we check GV->hasInitializer().. should we do something like that? (also the below code add OutStreamer->AddBlankLine(); after, should we do that too, and try to share code maybe?
================
Comment at: llvm/test/CodeGen/WebAssembly/externref-tableset.ll:97
-; CHECK: .tabletype externref_table, externref
+; CHECK-LABEL: externref_table:
+; CHECK-NEXT: .tabletype externref_table, externref
----------------
pmatos wrote:
> sbc100 wrote:
> > Wouldn't this line be declaring a defined table rather than an external/undefined one?
> But we are defining a table, right? In line 6 with `@externref_table = local_unnamed_addr addrspace(1) global [0 x %externref] undef`.
>
> You are right, I think in that `.tabletype` is enough to access an external table, which is why we don't need one for the `__funcref_call_table` in `funcref-table_call.ll`.
Oh I see, in that case that makes sense. I was thrown off by the `undef` on that line.. what does that signal?
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