Fix unused variable warnings:
authorKazu Hirata <kazu@google.com>
Mon, 19 Sep 2022 17:42:49 +0000 (10:42 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 19 Sep 2022 17:42:50 +0000 (10:42 -0700)
This patch fixes warnings during a release build:

  mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp:198:52: error:
  lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

  bolt/lib/Rewrite/RewriteInstance.cpp:5318:18: error: unused variable
  'HasNoAddress' [-Werror,-Wunused-variable]

bolt/lib/Rewrite/RewriteInstance.cpp
mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp

index dc92268..5c2d124 100644 (file)
@@ -5321,6 +5321,7 @@ void RewriteInstance::rewriteFile() {
       assert(llvm::all_of(Function->getLayout().getSplitFragments(),
                           HasNoAddress) &&
              "Some split fragments have an address while others do not");
+      (void)HasNoAddress;
       continue;
     }
 
index b78b8ab..258420e 100644 (file)
@@ -196,6 +196,7 @@ DiagnosedSilenceableFailure
 transform::TransformState::applyTransform(TransformOpInterface transform) {
   LLVM_DEBUG(DBGS() << "applying: " << transform << "\n");
   auto printOnFailureRAII = llvm::make_scope_exit([this] {
+    (void)this;
     DEBUG_WITH_TYPE(DEBUG_PRINT_AFTER_ALL, {
       DBGS() << "Top-level payload:\n";
       getTopLevel()->print(llvm::dbgs(),