From 9e296584cebbce97cdbb6759ea8ee7ea6faababc Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 20 Aug 2022 00:12:35 -0700 Subject: [PATCH] Fix unused variable warnings These warnings came up with gcc-11.3.0. --- lld/MachO/Driver.cpp | 2 +- lld/MachO/Writer.cpp | 2 +- mlir/include/mlir/IR/PatternMatch.h | 1 + mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp index 931f40182c55..c2473c77c9db 100644 --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -1151,7 +1151,7 @@ static void addSynthenticMethnames() { llvm::raw_string_ostream os(data); const int prefixLength = ObjCStubsSection::symbolPrefix.size(); for (Symbol *sym : symtab->getSymbols()) - if (const auto *undefined = dyn_cast(sym)) + if (isa(sym)) if (sym->getName().startswith(ObjCStubsSection::symbolPrefix)) os << sym->getName().drop_front(prefixLength) << '\0'; diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp index 4addaab81599..e23e592a1d98 100644 --- a/lld/MachO/Writer.cpp +++ b/lld/MachO/Writer.cpp @@ -695,7 +695,7 @@ void Writer::scanSymbols() { continue; dysym->getFile()->refState = std::max(dysym->getFile()->refState, dysym->getRefState()); - } else if (const auto *undefined = dyn_cast(sym)) { + } else if (isa(sym)) { if (sym->getName().startswith(ObjCStubsSection::symbolPrefix)) in.objcStubs->addEntry(sym); } diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h index 7b0a3be77308..84f2e2a94c8c 100644 --- a/mlir/include/mlir/IR/PatternMatch.h +++ b/mlir/include/mlir/IR/PatternMatch.h @@ -1097,6 +1097,7 @@ void assertArgs(PatternRewriter &rewriter, ArrayRef values, auto errorFn = [&](const Twine &msg) -> LogicalResult { llvm::report_fatal_error(msg); }; + (void)errorFn; (assert(succeeded( ProcessPDLValue>::verifyAsArg( errorFn, values[I], I))), diff --git a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp index ca82e32a83df..f85d8dfb279c 100644 --- a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp +++ b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp @@ -240,7 +240,7 @@ void AbstractSparseDataFlowAnalysis::visitRegionSuccessors( unsigned firstIndex = 0; if (inputs.size() != lattices.size()) { - if (auto *op = point.dyn_cast()) { + if (point.dyn_cast()) { if (!inputs.empty()) firstIndex = inputs.front().cast().getResultNumber(); visitNonControlFlowArgumentsImpl(