[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
Wed Jul 14 17:10:31 PDT 2021


sbc100 accepted this revision.
sbc100 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/wasm/SyntheticSections.cpp:113
+                                   StringRef *outName) {
+  if (auto *undef = dyn_cast<UndefinedT>(sym)) {
+    *outModule = undef->importModule ? *undef->importModule : defaultModule;
----------------
The fact that we need template here make me thing maybe we should just move importModule/importName into the symbol base class and we could then just do `isUndefined()` here... but that is a bigger change.


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


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

https://reviews.llvm.org/D105519



More information about the llvm-commits mailing list