[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 Aug 4 11:15:57 PDT 2021


sbc100 added inline comments.


================
Comment at: lld/wasm/SyntheticSections.h:134
+// key in a `DenseMap`.
+template <typename T> struct llvm::DenseMapInfo<lld::wasm::ImportKey<T>> {
+  static lld::wasm::ImportKey<T> getEmptyKey() {
----------------
TaoPan wrote:
> Please be note this line introduced below build error:
> FAILED: tools/lld/wasm/CMakeFiles/lldWasm.dir/MapFile.cpp.o 
> /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/lld/wasm -I/media/sdb/tao/llvm/llvm-project-debug/lld/wasm -I/media/sdb/tao/llvm/llvm-project-debug/lld/include -Itools/lld/include -Iinclude -I/media/sdb/tao/llvm/llvm-project-debug/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/lld/wasm/CMakeFiles/lldWasm.dir/MapFile.cpp.o -MF tools/lld/wasm/CMakeFiles/lldWasm.dir/MapFile.cpp.o.d -o tools/lld/wasm/CMakeFiles/lldWasm.dir/MapFile.cpp.o -c /media/sdb/tao/llvm/llvm-project-debug/lld/wasm/MapFile.cpp
> In file included from /media/sdb/tao/llvm/llvm-project-debug/lld/wasm/MapFile.cpp:28:0:
> /media/sdb/tao/llvm/llvm-project-debug/lld/wasm/SyntheticSections.h:134:36: error: specialization of ‘template<class T> struct llvm::DenseMapInfo’ in different namespace [-fpermissive]
>  template <typename T> struct llvm::DenseMapInfo<lld::wasm::ImportKey<T>> {
>                                     ^
> In file included from /media/sdb/tao/llvm/llvm-project-debug/lld/wasm/MapFile.h:12:0,
>                  from /media/sdb/tao/llvm/llvm-project-debug/lld/wasm/MapFile.cpp:21:
> /media/sdb/tao/llvm/llvm-project-debug/llvm/include/llvm/ADT/ArrayRef.h:29:31: error:   from definition of ‘template<class T> struct llvm::DenseMapInfo’ [-fpermissive]
>    template<typename T> struct DenseMapInfo;
What compiler are you using that gives this error?   I'm guessing gcc or something that is not clang?  (I'm surprised we didn't get any reports of bots failing?  Any idea why your config might not be covered by any of the llvn bots?)


@fitzgen can you take a look?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105519



More information about the llvm-commits mailing list