[PATCH] D105519: [WebAssembly] Deduplicate imports of the same module name, field name, and type

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 10:25:37 PDT 2021


sbc100 added inline comments.


================
Comment at: lld/wasm/SyntheticSections.h:156
+  }
+};
+
----------------
fitzgen wrote:
> sbc100 wrote:
> > What about putting `ImportKey` and this `DenseMapInfo` in that anonymous namespace since they should not be needed outside this file?  Then we could avoid the prefix in `lld::wasm::ImportKey` maybe?
> When I do this, I get the following warning a few times:
> 
> ```
> /home/nick/llvm-project/lld/wasm/SyntheticSections.h:165:7: warning: ‘lld::wasm::ImportSection’ has a field ‘lld::wasm::ImportSection::importedGlobals’ whose type uses the anonymous namespace [-Wsubobject-linkage]
>   165 | class ImportSection : public SyntheticSection {
>       |       ^~~~~~~~~~~~~
> ```
> 
> Do you still prefer this approach?
Oh sorry, I didn't realize this was in a header.   Ignore my previous comment.


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

https://reviews.llvm.org/D105519



More information about the llvm-commits mailing list