diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index b8f6de69bbb98..a2c55c71e09ae 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -3843,4 +3843,25 @@ typename clang::LazyGenerationalUpdatePtr::ValueType return Value; } +template <> struct llvm::DenseMapInfo { + static FoldingSetNodeID getEmptyKey() { return FoldingSetNodeID{}; } + + static FoldingSetNodeID getTombstoneKey() { + FoldingSetNodeID ID; + for (size_t I = 0; I < sizeof(ID) / sizeof(unsigned); ++I) { + ID.AddInteger(std::numeric_limits::max()); + } + return ID; + } + + static unsigned getHashValue(const FoldingSetNodeID &Val) { + return Val.ComputeHash(); + } + + static bool isEqual(const FoldingSetNodeID &LHS, + const FoldingSetNodeID &RHS) { + return LHS == RHS; + } +}; + #endif // LLVM_CLANG_AST_ASTCONTEXT_H diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 5240054c2f36b..e49ff9080571e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -114,27 +114,6 @@ enum FloatingRank { Ibm128Rank }; -template <> struct llvm::DenseMapInfo { - static FoldingSetNodeID getEmptyKey() { return FoldingSetNodeID{}; } - - static FoldingSetNodeID getTombstoneKey() { - FoldingSetNodeID id; - for (size_t i = 0; i < sizeof(id) / sizeof(unsigned); ++i) { - id.AddInteger(std::numeric_limits::max()); - } - return id; - } - - static unsigned getHashValue(const FoldingSetNodeID &Val) { - return Val.ComputeHash(); - } - - static bool isEqual(const FoldingSetNodeID &LHS, - const FoldingSetNodeID &RHS) { - return LHS == RHS; - } -}; - /// \returns The locations that are relevant when searching for Doc comments /// related to \p D. static SmallVector diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp index f114173a42c21..d238b7916a330 100644 --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -1864,33 +1864,6 @@ NormalizedConstraint::getFoldExpandedConstraint() const { // ------------------------ Subsumption ----------------------------------- // // - -template <> struct llvm::DenseMapInfo { - - static FoldingSetNodeID getEmptyKey() { - FoldingSetNodeID ID; - ID.AddInteger(std::numeric_limits::max()); - return ID; - } - - static FoldingSetNodeID getTombstoneKey() { - FoldingSetNodeID ID; - for (unsigned I = 0; I < sizeof(ID) / sizeof(unsigned); ++I) { - ID.AddInteger(std::numeric_limits::max()); - } - return ID; - } - - static unsigned getHashValue(const FoldingSetNodeID &Val) { - return Val.ComputeHash(); - } - - static bool isEqual(const FoldingSetNodeID &LHS, - const FoldingSetNodeID &RHS) { - return LHS == RHS; - } -}; - SubsumptionChecker::SubsumptionChecker(Sema &SemaRef, SubsumptionCallable Callable) : SemaRef(SemaRef), Callable(Callable), NextID(1) {}