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

Nick Fitzgerald via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 13:46:58 PDT 2021


fitzgen added inline comments.


================
Comment at: lld/wasm/SyntheticSections.h:156
+  }
+};
+
----------------
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?


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

https://reviews.llvm.org/D105519



More information about the llvm-commits mailing list