[llvm] suppresses unused variable warning (PR #99526)

Christopher Di Bella via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 09:59:58 PDT 2024


https://github.com/cjdb updated https://github.com/llvm/llvm-project/pull/99526

>From cb473986c7a12392dc1ba029bd04552d121fae76 Mon Sep 17 00:00:00 2001
From: Christopher Di Bella <cjdb at google.com>
Date: Thu, 18 Jul 2024 16:55:56 +0000
Subject: [PATCH 1/2] suppresses unused variable warning

---
 llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index b9cf36a07846c..3d90c0a2c0de3 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -3362,6 +3362,7 @@ void InstrRefBasedLDV::buildVLocValueMap(
       if (BlockLiveIn->Kind == DbgValue::VPHI)
         BlockLiveIn->Kind = DbgValue::Def;
       auto &[Var, DILoc] = DVMap.lookupDVID(VarID);
+      (void)DILoc;
       assert(BlockLiveIn->Properties.DIExpr->getFragmentInfo() ==
                  Var.getFragment() &&
              "Fragment info missing during value prop");

>From c153d4efedb30c7b9f8af72d7f52c69656c71fe9 Mon Sep 17 00:00:00 2001
From: Christopher Di Bella <cjdb at google.com>
Date: Thu, 18 Jul 2024 16:59:39 +0000
Subject: [PATCH 2/2] addresses feedback

---
 llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 3d90c0a2c0de3..0a6ce6a135817 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -3361,8 +3361,7 @@ void InstrRefBasedLDV::buildVLocValueMap(
         continue;
       if (BlockLiveIn->Kind == DbgValue::VPHI)
         BlockLiveIn->Kind = DbgValue::Def;
-      auto &[Var, DILoc] = DVMap.lookupDVID(VarID);
-      (void)DILoc;
+      [[maybe_unused]] auto &[Var, DILoc] = DVMap.lookupDVID(VarID);
       assert(BlockLiveIn->Properties.DIExpr->getFragmentInfo() ==
                  Var.getFragment() &&
              "Fragment info missing during value prop");



More information about the llvm-commits mailing list