[llvm] [DebugInfo] Fold a namespace into a std::hash specialization (NFC) (PR #165191)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Oct 26 20:37:33 PDT 2025
    
    
  
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-debuginfo
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/165191.diff
1 Files Affected:
- (modified) llvm/include/llvm/DebugInfo/PDB/PDBTypes.h (+1-5) 
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/165191
    
    
More information about the llvm-commits
mailing list