[PATCH] D118122: [WebAssembly] Refactor and fix emission of external IR global decls
Paulo Matos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 31 02:39:00 PST 2022
pmatos added inline comments.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:367
-void WebAssemblyAsmPrinter::emitEndOfAsmFile(Module &M) {
- emitExternalDecls(M);
----------------
sbc100 wrote:
> I guess this was here to handle the case that emitLinkage was never called? Does that not apply to emitConstantPool too?
>
> In other words, why remove this line?
>
So - in all my tests I couldn't find a reason for this line to exist. And I noticed that whenever it was called, it had generally been called through `emitLinkage`.
With this patch, `emitExternalDecls` is not called unless there are functions in the compilation unit. Globals are still emitted properly through `emitGlobalVariable` though. So this only leaves symbols that are necessary for use in functions, I think. But if those functions exist, they are emitted anyway, so I don't see the need for this.
Note that before this patch, this line was needed because we were emitting global symbol types in `emitExternalDecls`, and now we have move that to `emitGlobalVariable`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118122/new/
https://reviews.llvm.org/D118122
More information about the llvm-commits
mailing list