File indexing completed on 2026-05-10 08:36:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef LLVM_CLANG_AST_TYPEORDERING_H
0019 #define LLVM_CLANG_AST_TYPEORDERING_H
0020
0021 #include "clang/AST/CanonicalType.h"
0022 #include "clang/AST/Type.h"
0023 #include <functional>
0024
0025 namespace clang {
0026
0027
0028 struct QualTypeOrdering {
0029 bool operator()(QualType T1, QualType T2) const {
0030 return std::less<void*>()(T1.getAsOpaquePtr(), T2.getAsOpaquePtr());
0031 }
0032 };
0033
0034 }
0035
0036 namespace llvm {
0037
0038 template<> struct DenseMapInfo<clang::QualType> {
0039 static inline clang::QualType getEmptyKey() { return clang::QualType(); }
0040
0041 static inline clang::QualType getTombstoneKey() {
0042 using clang::QualType;
0043 return QualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
0044 }
0045
0046 static unsigned getHashValue(clang::QualType Val) {
0047 return (unsigned)((uintptr_t)Val.getAsOpaquePtr()) ^
0048 ((unsigned)((uintptr_t)Val.getAsOpaquePtr() >> 9));
0049 }
0050
0051 static bool isEqual(clang::QualType LHS, clang::QualType RHS) {
0052 return LHS == RHS;
0053 }
0054 };
0055
0056 template<> struct DenseMapInfo<clang::CanQualType> {
0057 static inline clang::CanQualType getEmptyKey() {
0058 return clang::CanQualType();
0059 }
0060
0061 static inline clang::CanQualType getTombstoneKey() {
0062 using clang::CanQualType;
0063 return CanQualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
0064 }
0065
0066 static unsigned getHashValue(clang::CanQualType Val) {
0067 return (unsigned)((uintptr_t)Val.getAsOpaquePtr()) ^
0068 ((unsigned)((uintptr_t)Val.getAsOpaquePtr() >> 9));
0069 }
0070
0071 static bool isEqual(clang::CanQualType LHS, clang::CanQualType RHS) {
0072 return LHS == RHS;
0073 }
0074 };
0075 }
0076
0077 #endif