[PATCH] D91637: [WebAssembly] Only emit indirect function table import if needed
Andy Wingo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 19 00:36:00 PST 2020
wingo added inline comments.
================
Comment at: llvm/lib/MC/WasmObjectWriter.cpp:506
+ BaseSym->setUsedInReloc();
+ Asm.registerSymbol(*BaseSym);
+ }
----------------
wingo wrote:
> sbc100 wrote:
> > Can we just move the code below, or make it conditional to avoid the MCConteext changes?
> >
> > (i.e. can we make this change local to this file?)
> >
> >
> We certainly can. However, with the next patch, we will need to call `getOrCreateWasmDefaultFunctionTableSymbol` from three places in `Target/WebAssembly`: the asm parser and from the two instruction selectors. Do you prefer to duplicate this code there?
In the end I think you are right and that in this patch, no need to muck with MCContext.h. If we should factor out a function, it will become obvious in future patches.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91637/new/
https://reviews.llvm.org/D91637
More information about the llvm-commits
mailing list