From c907d6e0e9fd8fafd49e4d0f9e584f58bbac5ead Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Tue, 17 May 2022 14:30:00 -0700 Subject: [PATCH] [BOLT][NFC] Suppress unused variable warnings Addresses the warnings emitted by Apple Clang 13.1.6 (Xcode 13.3.1). Tip @tschuett issue #55404. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D125733 --- bolt/lib/Core/BinaryBasicBlock.cpp | 1 + bolt/lib/Core/BinaryContext.cpp | 2 ++ bolt/lib/Rewrite/RewriteInstance.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/bolt/lib/Core/BinaryBasicBlock.cpp b/bolt/lib/Core/BinaryBasicBlock.cpp index 5f3a3431fcd0..5ff4044e7295 100644 --- a/bolt/lib/Core/BinaryBasicBlock.cpp +++ b/bolt/lib/Core/BinaryBasicBlock.cpp @@ -328,6 +328,7 @@ void BinaryBasicBlock::removePredecessor(BinaryBasicBlock *Pred, } } assert(Erased && "Pred is not a predecessor of this block!"); + (void)Erased; } void BinaryBasicBlock::removeDuplicateConditionalSuccessor(MCInst *CondBranch) { diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp index 6ebed6b68108..dd2a51ceae6f 100644 --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -809,6 +809,7 @@ BinaryContext::duplicateJumpTable(BinaryFunction &Function, JumpTable *JT, break; } assert(Found && "Label not found"); + (void)Found; MCSymbol *NewLabel = Ctx->createNamedTempSymbol("duplicatedJT"); JumpTable *NewJT = new JumpTable(*NewLabel, JT->getAddress(), JT->EntrySize, JT->Type, @@ -1172,6 +1173,7 @@ void BinaryContext::postProcessSymbolTable() { } } assert(Valid); + (void)Valid; generateSymbolHashes(); } diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index dd128161e233..2d3f987af959 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4048,6 +4048,7 @@ void RewriteInstance::rewriteNoteSections() { if (BSec->getAllocAddress()) { assert(!DataWritten && "Writing section twice."); + (void)DataWritten; SectionData = BSec->getOutputData(); LLVM_DEBUG(dbgs() << "BOLT-DEBUG: " << (Size ? "appending" : "writing")