Fix unused variable warnings

These warnings came up with gcc-11.3.0.
This commit is contained in:
Kazu Hirata 2022-08-20 00:12:35 -07:00
parent d92f49fc4b
commit 9e296584ce
4 changed files with 4 additions and 3 deletions

View File

@ -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';

View File

@ -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);
}

View File

@ -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))),

View File

@ -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(