[Mlir-commits] [mlir] 9e29658 - Fix unused variable warnings
Kazu Hirata
llvmlistbot at llvm.org
Sat Aug 20 00:12:46 PDT 2022
Author: Kazu Hirata
Date: 2022-08-20T00:12:35-07:00
New Revision: 9e296584cebbce97cdbb6759ea8ee7ea6faababc
URL: https://github.com/llvm/llvm-project/commit/9e296584cebbce97cdbb6759ea8ee7ea6faababc
DIFF: https://github.com/llvm/llvm-project/commit/9e296584cebbce97cdbb6759ea8ee7ea6faababc.diff
LOG: Fix unused variable warnings
These warnings came up with gcc-11.3.0.
Added:
Modified:
lld/MachO/Driver.cpp
lld/MachO/Writer.cpp
mlir/include/mlir/IR/PatternMatch.h
mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
Removed:
################################################################################
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 931f40182c55d..c2473c77c9db8 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<Undefined>(sym))
+ if (isa<Undefined>(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 4addaab815998..e23e592a1d984 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<Undefined>(sym)) {
+ } else if (isa<Undefined>(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 7b0a3be77308d..84f2e2a94c8c5 100644
--- a/mlir/include/mlir/IR/PatternMatch.h
+++ b/mlir/include/mlir/IR/PatternMatch.h
@@ -1097,6 +1097,7 @@ void assertArgs(PatternRewriter &rewriter, ArrayRef<PDLValue> values,
auto errorFn = [&](const Twine &msg) -> LogicalResult {
llvm::report_fatal_error(msg);
};
+ (void)errorFn;
(assert(succeeded(
ProcessPDLValue<typename FnTraitsT::template arg_t<I + 1>>::verifyAsArg(
errorFn, values[I], I))),
diff --git a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
index ca82e32a83df9..f85d8dfb279c6 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<Operation *>()) {
+ if (point.dyn_cast<Operation *>()) {
if (!inputs.empty())
firstIndex = inputs.front().cast<OpResult>().getResultNumber();
visitNonControlFlowArgumentsImpl(
More information about the Mlir-commits
mailing list