[llvm] r375117 - [clangd] Use our own relation kind.
Haojian Wu via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 07:08:29 PDT 2019
Author: hokein
Date: Thu Oct 17 07:08:28 2019
New Revision: 375117
URL: http://llvm.org/viewvc/llvm-project?rev=375117&view=rev
Log:
[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
Modified:
llvm/trunk/include/llvm/ADT/DenseMapInfo.h
Modified: llvm/trunk/include/llvm/ADT/DenseMapInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMapInfo.h?rev=375117&r1=375116&r2=375117&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMapInfo.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMapInfo.h Thu Oct 17 07:08:28 2019
@@ -67,6 +67,17 @@ template<> struct DenseMapInfo<char> {
}
};
+// Provide DenseMapInfo for unsigned chars.
+template <> struct DenseMapInfo<unsigned char> {
+ 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<unsigned short> {
static inline unsigned short getEmptyKey() { return 0xFFFF; }
More information about the llvm-commits
mailing list