summaryrefslogtreecommitdiff
path: root/llvm/include/llvm/Object
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Object')
-rw-r--r--llvm/include/llvm/Object/Wasm.h1
-rw-r--r--llvm/include/llvm/Object/WasmTraits.h14
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/include/llvm/Object/Wasm.h b/llvm/include/llvm/Object/Wasm.h
index 85cd40aee5b..25903fc9945 100644
--- a/llvm/include/llvm/Object/Wasm.h
+++ b/llvm/include/llvm/Object/Wasm.h
@@ -22,6 +22,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/Config/llvm-config.h"
+#include "llvm/MC/MCSymbolWasm.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/Object/WasmTraits.h b/llvm/include/llvm/Object/WasmTraits.h
index ebcd00b1522..049d72f79e4 100644
--- a/llvm/include/llvm/Object/WasmTraits.h
+++ b/llvm/include/llvm/Object/WasmTraits.h
@@ -24,14 +24,20 @@ template <typename T> struct DenseMapInfo;
// Traits for using WasmSignature in a DenseMap.
template <> struct DenseMapInfo<wasm::WasmSignature> {
static wasm::WasmSignature getEmptyKey() {
- return wasm::WasmSignature{{}, 1};
+ wasm::WasmSignature Sig;
+ Sig.State = wasm::WasmSignature::Empty;
+ return Sig;
}
static wasm::WasmSignature getTombstoneKey() {
- return wasm::WasmSignature{{}, 2};
+ wasm::WasmSignature Sig;
+ Sig.State = wasm::WasmSignature::Tombstone;
+ return Sig;
}
static unsigned getHashValue(const wasm::WasmSignature &Sig) {
- unsigned H = hash_value(Sig.ReturnType);
- for (int32_t Param : Sig.ParamTypes)
+ uintptr_t H = hash_value(Sig.State);
+ for (auto Ret : Sig.Returns)
+ H = hash_combine(H, Ret);
+ for (auto Param : Sig.Params)
H = hash_combine(H, Param);
return H;
}