[clang] Revert "Mix bits in FileID::getHashValue() (#223794)" (PR #224394)

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 12:49:40 PDT 2026


https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/224394

This reverts commit 9bc655d2852ec31199f2dba25d6f0749953fbe51.

It broke a couple of tests in clang/test/Analysis/html_diagnostics.

>From b2199afb4cb2d7f80ec9fae7ad713817d1349fd5 Mon Sep 17 00:00:00 2001
From: Akira Hatanaka <ahatanak at gmail.com>
Date: Thu, 17 Sep 2026 12:45:36 -0700
Subject: [PATCH] Revert "Mix bits in FileID::getHashValue() (#223794)"

This reverts commit 9bc655d2852ec31199f2dba25d6f0749953fbe51.

It broke a couple of tests in clang/test/Analysis/html_diagnostics.
---
 clang/include/clang/Basic/SourceLocation.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/clang/include/clang/Basic/SourceLocation.h b/clang/include/clang/Basic/SourceLocation.h
index b83ee383d45c0..b42b7e78622c6 100644
--- a/clang/include/clang/Basic/SourceLocation.h
+++ b/clang/include/clang/Basic/SourceLocation.h
@@ -53,10 +53,7 @@ class FileID {
   bool operator>=(const FileID &RHS) const { return RHS <= *this; }
 
   static FileID getSentinel() { return get(-1); }
-  unsigned getHashValue() const {
-    // Multiply by 37 to spread the keys to avoid clustering in DenseMap.
-    return static_cast<unsigned>(ID) * 37U;
-  }
+  unsigned getHashValue() const { return static_cast<unsigned>(ID); }
 
 private:
   friend class ASTWriter;



More information about the cfe-commits mailing list