[llvm] 6cb942c - [llvm] Remove argument_type in std::hash specializations (NFC) (#165167)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 26 15:20:11 PDT 2025
Author: Kazu Hirata
Date: 2025-10-26T15:20:07-07:00
New Revision: 6cb942cec44e66c9507876ca09ce203c7722417a
URL: https://github.com/llvm/llvm-project/commit/6cb942cec44e66c9507876ca09ce203c7722417a
DIFF: https://github.com/llvm/llvm-project/commit/6cb942cec44e66c9507876ca09ce203c7722417a.diff
LOG: [llvm] Remove argument_type in std::hash specializations (NFC) (#165167)
The argument_type and result_type type aliases in std::hash are
deprecated in C++17 and removed in C++20. This patch aligns two
specializations of ours with the C++ standard.
Added:
Modified:
llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
index a64a2e888e9b9..7af2ff1290abe 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -600,10 +600,7 @@ struct Variant {
namespace std {
template <> struct hash<llvm::pdb::PDB_SymType> {
- using argument_type = llvm::pdb::PDB_SymType;
- using result_type = std::size_t;
-
- result_type operator()(const argument_type &Arg) const {
+ std::size_t operator()(const llvm::pdb::PDB_SymType &Arg) const {
return std::hash<int>()(static_cast<int>(Arg));
}
};
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index 93ae5483dedbb..7bef3a8f4d3ff 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -86,10 +86,7 @@ template <> struct llvm::DenseMapInfo<VariableID> {
using VarLocInsertPt = PointerUnion<const Instruction *, const DbgRecord *>;
template <> struct std::hash<VarLocInsertPt> {
- using argument_type = VarLocInsertPt;
- using result_type = std::size_t;
-
- result_type operator()(const argument_type &Arg) const {
+ std::size_t operator()(const VarLocInsertPt &Arg) const {
return std::hash<void *>()(Arg.getOpaqueValue());
}
};
More information about the llvm-commits
mailing list