diff --git a/clang-tools-extra/clangd/index/Index.h b/clang-tools-extra/clangd/index/Index.h index 8cb1caf54c38..6d4711cccb13 100644 --- a/clang-tools-extra/clangd/index/Index.h +++ b/clang-tools-extra/clangd/index/Index.h @@ -12,6 +12,7 @@ #include "clang/Index/IndexSymbol.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/Hashing.h" #include "llvm/ADT/StringExtras.h" #include @@ -49,7 +50,9 @@ public: } private: - friend class llvm::DenseMapInfo; + friend llvm::hash_code hash_value(const SymbolID &ID) { + return hash_value(ArrayRef(ID.HashValue)); + } std::array HashValue; }; @@ -122,8 +125,7 @@ template <> struct DenseMapInfo { return TombstoneKey; } static unsigned getHashValue(const clang::clangd::SymbolID &Sym) { - return hash_value( - ArrayRef(Sym.HashValue.data(), Sym.HashValue.size())); + return hash_value(Sym); } static bool isEqual(const clang::clangd::SymbolID &LHS, const clang::clangd::SymbolID &RHS) {