From: Haojian Wu Date: Thu, 17 Oct 2019 14:08:28 +0000 (+0000) Subject: [clangd] Use our own relation kind. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0521e5fc0df8e80327db9b5b96de271ad624621;p=llvm [clangd] Use our own relation kind. Summary: Move the RelationKind from Serialization.h to Relation.h. This patch doesn't introduce any breaking changes. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68981 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375117 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/DenseMapInfo.h b/include/llvm/ADT/DenseMapInfo.h index c4e8f2d4abc..bd4c60c8f13 100644 --- a/include/llvm/ADT/DenseMapInfo.h +++ b/include/llvm/ADT/DenseMapInfo.h @@ -67,6 +67,17 @@ template<> struct DenseMapInfo { } }; +// Provide DenseMapInfo for unsigned chars. +template <> struct DenseMapInfo { + static inline unsigned char getEmptyKey() { return ~0; } + static inline unsigned char getTombstoneKey() { return ~0 - 1; } + static unsigned getHashValue(const unsigned char &Val) { return Val * 37U; } + + static bool isEqual(const unsigned char &LHS, const unsigned char &RHS) { + return LHS == RHS; + } +}; + // Provide DenseMapInfo for unsigned shorts. template <> struct DenseMapInfo { static inline unsigned short getEmptyKey() { return 0xFFFF; }