[PATCH] D92840: [WebAssembly] call_indirect causes indirect function table import

Andy Wingo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 01:16:46 PST 2020


wingo added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp:167
+  // which itself duplicates MC/WasmObjectWriter; rework to factor out a utils
+  // component?
+  MCSymbolWasm *Sym = cast_or_null<MCSymbolWasm>(Ctx.lookupSymbol(Name));
----------------
aheejin wrote:
> I'm not sure if there's an easy way to factor out so all three places can use it, but at least can't we use WebAssemblyUtilities.cpp's `getOrCreateFunctionTableSymbol` here and not define it again? Can't we do `#include "WebAssemblyUtilities.h" and use its function?
Sadly we can't directly re-use it here, for reasons I don't fully understand.  If you #include the WebAssemblyUtilities.h file, it compiles fine but `llvm-mc` fails to link.  It would seem that one might need to factor WebAssemblyUtilities to a separate cmake component.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92840



More information about the llvm-commits mailing list