[lld] 825d760 - [lld][WebAssembly] Remove vestigial ImportKey::State after DenseMapInfo cleanup (#202082)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 6 13:41:05 PDT 2026
Author: Fangrui Song
Date: 2026-06-06T13:41:01-07:00
New Revision: 825d760892c77c00da0eb4a01c5f2397c49c9585
URL: https://github.com/llvm/llvm-project/commit/825d760892c77c00da0eb4a01c5f2397c49c9585
DIFF: https://github.com/llvm/llvm-project/commit/825d760892c77c00da0eb4a01c5f2397c49c9585.diff
LOG: [lld][WebAssembly] Remove vestigial ImportKey::State after DenseMapInfo cleanup (#202082)
Unused after #201989 removed getEmptyKey()
Added:
Modified:
lld/wasm/SyntheticSections.h
Removed:
################################################################################
diff --git a/lld/wasm/SyntheticSections.h b/lld/wasm/SyntheticSections.h
index 493ef95a165e5..e0bd91a739026 100644
--- a/lld/wasm/SyntheticSections.h
+++ b/lld/wasm/SyntheticSections.h
@@ -101,27 +101,21 @@ class TypeSection : public SyntheticSection {
* Used when de-duplicating imports.
*/
template <typename T> struct ImportKey {
-public:
- enum class State { Plain, Empty };
-
public:
T type;
std::optional<StringRef> importModule;
std::optional<StringRef> importName;
- State state;
public:
- ImportKey(T type) : type(type), state(State::Plain) {}
- ImportKey(T type, State state) : type(type), state(state) {}
+ ImportKey(T type) : type(type) {}
ImportKey(T type, std::optional<StringRef> importModule,
std::optional<StringRef> importName)
- : type(type), importModule(importModule), importName(importName),
- state(State::Plain) {}
+ : type(type), importModule(importModule), importName(importName) {}
};
template <typename T>
inline bool operator==(const ImportKey<T> &lhs, const ImportKey<T> &rhs) {
- return lhs.state == rhs.state && lhs.importModule == rhs.importModule &&
+ return lhs.importModule == rhs.importModule &&
lhs.importName == rhs.importName && lhs.type == rhs.type;
}
@@ -135,7 +129,6 @@ template <typename T> struct DenseMapInfo<lld::wasm::ImportKey<T>> {
uintptr_t hash = hash_value(key.importModule);
hash = hash_combine(hash, key.importName);
hash = hash_combine(hash, llvm::DenseMapInfo<T>::getHashValue(key.type));
- hash = hash_combine(hash, key.state);
return hash;
}
static bool isEqual(const lld::wasm::ImportKey<T> &lhs,
More information about the llvm-commits
mailing list