[PATCH] D96001: [WebAssembly][lld] Preassign table number 0 to indirect function table for MVP inputs
Andy Wingo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 12 08:06:02 PST 2021
wingo added inline comments.
================
Comment at: lld/test/wasm/invalid-mvp-table-use.s:3
+#
+# Can't define tables in MVP files.
+# RUN: not wasm-ld --no-entry %t.o -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-ERR %s
----------------
sbc100 wrote:
> Can you elaborate on this comment. What makes this an MVP file ? Is it simply the lack of `-mattr=+reference-types`.
>
> Not part of this PR, but should we have llvm-mc fail here to catch this earlier?
Elaborated. As regards llvm-mc, there will need to be some changes when we finally add (again) support for symtab entries; will follow up then.
================
Comment at: lld/wasm/InputFiles.cpp:375
}
- for (const auto &table : tables) {
- auto *info = make<llvm::wasm::WasmSymbolInfo>();
- // Empty name.
- info->Kind = WASM_SYMBOL_TYPE_TABLE;
- info->Flags = WASM_SYMBOL_BINDING_LOCAL;
- info->Flags |= WASM_SYMBOL_VISIBILITY_HIDDEN;
- info->Flags |= WASM_SYMBOL_NO_STRIP;
- info->ElementIndex = tableNumber++;
- LLVM_DEBUG(dbgs() << "Synthesizing symbol for table definition: "
- << info->Name << "\n");
- auto *wasmSym = make<WasmSymbol>(*info, globalType, &table->getType(),
- eventType, signature);
- symbols.push_back(createDefined(*wasmSym));
- // Mark live, for the same reasons as for imported tables.
- symbols.back()->markLive();
+ assert(tableImport);
+
----------------
sbc100 wrote:
> Can we replace this above block with simply:
Missing comment here, perhaps?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96001/new/
https://reviews.llvm.org/D96001
More information about the llvm-commits
mailing list