[llvm] [nfc] Ignoring unused values (PR #125695)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 23:53:04 PST 2025


https://github.com/natanelh-mobileye updated https://github.com/llvm/llvm-project/pull/125695

>From d61a9ff79fa2a5e20d4796e8695130b558d98c88 Mon Sep 17 00:00:00 2001
From: natanelh-mobileye <natanelh at mobileye.com>
Date: Tue, 4 Feb 2025 16:51:30 +0200
Subject: [PATCH 1/2] [nfc] Ignoring unused values

trying to avoid `unused variable` warning under gcc7
---
 llvm/include/llvm/ADT/StableHashing.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/ADT/StableHashing.h b/llvm/include/llvm/ADT/StableHashing.h
index b220a0ed1f9131..964e4d52a932c4 100644
--- a/llvm/include/llvm/ADT/StableHashing.h
+++ b/llvm/include/llvm/ADT/StableHashing.h
@@ -54,13 +54,13 @@ inline stable_hash stable_hash_combine(stable_hash A, stable_hash B,
 // maintain closeness to the original name across different builds.
 inline StringRef get_stable_name(StringRef Name) {
   // Return the part after ".content." that represents contents.
-  auto [P0, S0] = Name.rsplit(".content.");
+  auto [std::ignore, S0] = Name.rsplit(".content.");
   if (!S0.empty())
     return S0;
 
   // Ignore these suffixes.
-  auto [P1, S1] = Name.rsplit(".llvm.");
-  auto [P2, S2] = P1.rsplit(".__uniq.");
+  auto [P1, std::ignore] = Name.rsplit(".llvm.");
+  auto [P2, std::ignore] = P1.rsplit(".__uniq.");
   return P2;
 }
 

>From cb1e751f560506062d96a7a95085915157d0c386 Mon Sep 17 00:00:00 2001
From: natanelh-mobileye <natanelh at mobileye.com>
Date: Wed, 5 Feb 2025 09:41:30 +0200
Subject: [PATCH 2/2] Update StableHashing.h

---
 llvm/include/llvm/ADT/StableHashing.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/ADT/StableHashing.h b/llvm/include/llvm/ADT/StableHashing.h
index 964e4d52a932c4..f6890663e5b4d2 100644
--- a/llvm/include/llvm/ADT/StableHashing.h
+++ b/llvm/include/llvm/ADT/StableHashing.h
@@ -54,13 +54,13 @@ inline stable_hash stable_hash_combine(stable_hash A, stable_hash B,
 // maintain closeness to the original name across different builds.
 inline StringRef get_stable_name(StringRef Name) {
   // Return the part after ".content." that represents contents.
-  auto [std::ignore, S0] = Name.rsplit(".content.");
+  StringRef S0 = Name.rsplit(".content.").second;
   if (!S0.empty())
     return S0;
 
   // Ignore these suffixes.
-  auto [P1, std::ignore] = Name.rsplit(".llvm.");
-  auto [P2, std::ignore] = P1.rsplit(".__uniq.");
+  StringRef P1 = Name.rsplit(".llvm.").first;
+  StringRef P2 = P1.rsplit(".__uniq.").first;
   return P2;
 }
 



More information about the llvm-commits mailing list