[llvm] [BOLT] Call hash_combine_range with ranges (NFC) (PR #136524)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 20 18:42:52 PDT 2025


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

None

>From 363e4401358bfbf50ac5a951910a24220e8a99ec Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 20 Apr 2025 15:11:18 -0700
Subject: [PATCH] [BOLT] Call hash_combine_range with ranges (NFC)

---
 bolt/lib/Profile/YAMLProfileWriter.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bolt/lib/Profile/YAMLProfileWriter.cpp b/bolt/lib/Profile/YAMLProfileWriter.cpp
index e394858163560..2bdc7b65b4804 100644
--- a/bolt/lib/Profile/YAMLProfileWriter.cpp
+++ b/bolt/lib/Profile/YAMLProfileWriter.cpp
@@ -133,12 +133,9 @@ std::vector<yaml::bolt::PseudoProbeInfo>
 YAMLProfileWriter::convertNodeProbes(NodeIdToProbes &NodeProbes) {
   struct BlockProbeInfoHasher {
     size_t operator()(const yaml::bolt::PseudoProbeInfo &BPI) const {
-      auto HashCombine = [](auto &Range) {
-        return llvm::hash_combine_range(Range.begin(), Range.end());
-      };
-      return llvm::hash_combine(HashCombine(BPI.BlockProbes),
-                                HashCombine(BPI.CallProbes),
-                                HashCombine(BPI.IndCallProbes));
+      return llvm::hash_combine(llvm::hash_combine_range(BPI.BlockProbes),
+                                llvm::hash_combine_range(BPI.CallProbes),
+                                llvm::hash_combine_range(BPI.IndCallProbes));
     }
   };
 



More information about the llvm-commits mailing list