aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-08-20 00:12:35 -0700
committerKazu Hirata <kazu@google.com>2022-08-20 00:12:35 -0700
commit9e296584cebbce97cdbb6759ea8ee7ea6faababc (patch)
treec5d4f043e3adf4e9549aa171f96920a263df58ea
parentd92f49fc4b22a738bd39e4588543b0a23037bd69 (diff)
downloadllvm-9e296584cebbce97cdbb6759ea8ee7ea6faababc.zip
llvm-9e296584cebbce97cdbb6759ea8ee7ea6faababc.tar.gz
llvm-9e296584cebbce97cdbb6759ea8ee7ea6faababc.tar.bz2
Fix unused variable warnings
These warnings came up with gcc-11.3.0.
-rw-r--r--lld/MachO/Driver.cpp2
-rw-r--r--lld/MachO/Writer.cpp2
-rw-r--r--mlir/include/mlir/IR/PatternMatch.h1
-rw-r--r--mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp2
4 files changed, 4 insertions, 3 deletions
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 931f401..c2473c7 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 4addaab..e23e592 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 7b0a3be..84f2e2a 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 ca82e32..f85d8df 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(