[clang] 4061354 - [Serialization] Revert specialization for DenseMapInfo<GlobalDeclID>::getHashValue

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 23 20:22:39 PDT 2024


Author: Chuanqi Xu
Date: 2024-06-24T11:20:09+08:00
New Revision: 4061354ab3157255238cf2664b9482bd6297dc83

URL: https://github.com/llvm/llvm-project/commit/4061354ab3157255238cf2664b9482bd6297dc83
DIFF: https://github.com/llvm/llvm-project/commit/4061354ab3157255238cf2664b9482bd6297dc83.diff

LOG: [Serialization] Revert specialization for DenseMapInfo<GlobalDeclID>::getHashValue

The FIXME says to revert this when the underlying issue got fixed. And
now the underlying issue got fixed in
https://github.com/llvm/llvm-project/pull/95734. So I think it should be
fine to rever that one now.

Added: 
    

Modified: 
    clang/include/clang/AST/DeclID.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/DeclID.h b/clang/include/clang/AST/DeclID.h
index e8f4860e13f1f..65d8108470e7b 100644
--- a/clang/include/clang/AST/DeclID.h
+++ b/clang/include/clang/AST/DeclID.h
@@ -259,11 +259,7 @@ template <> struct DenseMapInfo<clang::GlobalDeclID> {
   }
 
   static unsigned getHashValue(const GlobalDeclID &Key) {
-    // Our default hash algorithm for 64 bits integer may not be very good.
-    // In GlobalDeclID's case, it is pretty common that the lower 32 bits can
-    // be same.
-    // FIXME: Remove this when we fix the underlying issue.
-    return llvm::hash_value(Key.getRawValue());
+    return DenseMapInfo<DeclID>::getHashValue(Key.getRawValue());
   }
 
   static bool isEqual(const GlobalDeclID &L, const GlobalDeclID &R) {


        


More information about the cfe-commits mailing list