[PATCH] D43856: [WebAssembly] Improve WasmSignatureDenseMapInfo.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 09:35:31 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD326336: [WebAssembly] Improve WasmSignatureDenseMapInfo. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43856?vs=136222&id=136313#toc

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D43856

Files:
  wasm/Writer.cpp


Index: wasm/Writer.cpp
===================================================================
--- wasm/Writer.cpp
+++ wasm/Writer.cpp
@@ -53,11 +53,10 @@
     return Sig;
   }
   static unsigned getHashValue(const WasmSignature &Sig) {
-    uintptr_t Value = 0;
-    Value += DenseMapInfo<int32_t>::getHashValue(Sig.ReturnType);
+    unsigned H = hash_value(Sig.ReturnType);
     for (int32_t Param : Sig.ParamTypes)
-      Value += DenseMapInfo<int32_t>::getHashValue(Param);
-    return Value;
+      H = hash_combine(H, Param);
+    return H;
   }
   static bool isEqual(const WasmSignature &LHS, const WasmSignature &RHS) {
     return LHS == RHS;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43856.136313.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/25c1bb4b/attachment.bin>


More information about the llvm-commits mailing list