[llvm] [BOLT] Fix unused variable warning (PR #93253)
Sayhaan Siddiqui via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 16:28:25 PDT 2024
https://github.com/sayhaan created https://github.com/llvm/llvm-project/pull/93253
This fixes
```
/data/sandcastle/boxes/trunk-grepo-llvm-c2-grepo/llvm-project/bolt/lib/Rewrite/DWARFRewriter.cpp:76:45: warning: variable 'AbbrDecl' set but not used [-Wunused-but-set-variable]
76 | if (const DWARFAbbreviationDeclaration *AbbrDecl =
```
>From 0082a6bd87da5ac13058311141163dee4307ca2b Mon Sep 17 00:00:00 2001
From: Sayhaan Siddiqui <sayhaan at meta.com>
Date: Thu, 23 May 2024 16:12:51 -0700
Subject: [PATCH] [BOLT] Fix unused variable warning
---
bolt/lib/Rewrite/DWARFRewriter.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index d582ce7b33a27..d2a7cbdbb1a2b 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -73,8 +73,8 @@ static void printDie(DWARFUnit &DU, uint64_t DIEOffset) {
DWARFDataExtractor DebugInfoData = DU.getDebugInfoExtractor();
DWARFDebugInfoEntry DIEEntry;
if (DIEEntry.extractFast(DU, &DIEOffset, DebugInfoData, NextCUOffset, 0)) {
- if (const DWARFAbbreviationDeclaration *AbbrDecl =
- DIEEntry.getAbbreviationDeclarationPtr()) {
+ const DWARFAbbreviationDeclaration *AbbrDecl;
+ if (AbbrDecl = DIEEntry.getAbbreviationDeclarationPtr()) {
DWARFDie DDie(&DU, &DIEEntry);
printDie(DDie);
} else {
More information about the llvm-commits
mailing list