[PATCH] D115749: [WebAssembly] Emit symbol labels for table global symbols

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 17 23:59:58 PST 2022


pmatos added a comment.

In D115749#3248936 <https://reviews.llvm.org/D115749#3248936>, @sbc100 wrote:

> In D115749#3248640 <https://reviews.llvm.org/D115749#3248640>, @pmatos wrote:
>
>> @sbc100 I think I understand where this is going wrong. As far as I understand `emitExternalDecls` should only be emitting `.functype`, etc directives for external symbols and yet it's doing so for all symbols in `OutContext`, even those which are not external. I will have to revisit my assumptions and take a look at the code again, since the current solution of running `emitExternalDecls` in `onFinalization` means all directives come at the end and that doesn't work because it complains if, for example a reference to `bar` comes before `bar`s type declaration.
>
> Yes, it makes sense to me that emitExternalDecls only applies to external symbols (those not defined in the module).    However, I would have thought that for typechecking reasons (we do basic type checking, unlike other asm backend) that all the external decls always come first.

Yes, it's the type checking that's tripping the current patch. My plan is to go back to `emitExternalDecls` and ensure we really only emit the external decls first.


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