[llvm] [DebugInfo] Fold a namespace into a std::hash specialization (NFC) (PR #165191)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 26 20:36:48 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/165191

This patch folds "std" into the std::hash specialization so that the
template mentions std::hash.  std::hash is much easier to recognize
than std and hash separated by a couple of lines.


>From 9908e4936291a5acccaca28e46d0c65481fd0a68 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 26 Oct 2025 15:23:45 -0700
Subject: [PATCH] [DebugInfo] Fold a namespace into a std::hash specialization
 (NFC)

This patch folds "std" into the std::hash specialization so that the
template mentions std::hash.  std::hash is much easier to recognize
than std and hash separated by a couple of lines.
---
 llvm/include/llvm/DebugInfo/PDB/PDBTypes.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
index 7af2ff1290abe..c919b5f4d9f63 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -597,14 +597,10 @@ struct Variant {
 } // end namespace pdb
 } // end namespace llvm
 
-namespace std {
-
-template <> struct hash<llvm::pdb::PDB_SymType> {
+template <> struct std::hash<llvm::pdb::PDB_SymType> {
   std::size_t operator()(const llvm::pdb::PDB_SymType &Arg) const {
     return std::hash<int>()(static_cast<int>(Arg));
   }
 };
 
-} // end namespace std
-
 #endif // LLVM_DEBUGINFO_PDB_PDBTYPES_H



More information about the llvm-commits mailing list