[BOLT][NFC] Suppress unused variable warnings
authorAmir Ayupov <aaupov@fb.com>
Tue, 17 May 2022 21:30:00 +0000 (14:30 -0700)
committerAmir Ayupov <aaupov@fb.com>
Tue, 17 May 2022 21:30:23 +0000 (14:30 -0700)
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
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Rewrite/RewriteInstance.cpp

index 5f3a343..5ff4044 100644 (file)
@@ -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) {
index 6ebed6b..dd2a51c 100644 (file)
@@ -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();
 }
 
index dd12816..2d3f987 100644 (file)
@@ -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")