From: Mehdi Amini Date: Thu, 3 Nov 2022 21:39:14 +0000 (+0000) Subject: Apply clang-tidy fixes for llvm-qualified-auto in AttrOrTypeFormatGen.cpp (NFC) X-Git-Tag: upstream/17.0.6~27796 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e9cd81d3fd08aa52b645946b4235f1112170333;p=platform%2Fupstream%2Fllvm.git Apply clang-tidy fixes for llvm-qualified-auto in AttrOrTypeFormatGen.cpp (NFC) --- diff --git a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp index da2455b6..0469b28 100644 --- a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp +++ b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp @@ -1006,7 +1006,7 @@ DefFormatParser::verifyOptionalGroupElements(llvm::SMLoc loc, } else if (auto *custom = dyn_cast(el)) { for (FormatElement *el : custom->getArguments()) { // If the custom argument is a variable, then it must be optional. - if (auto param = dyn_cast(el)) + if (auto *param = dyn_cast(el)) if (!param->isOptional()) return emitError(loc, "`custom` is only allowed in an optional group if " @@ -1023,10 +1023,11 @@ DefFormatParser::verifyOptionalGroupElements(llvm::SMLoc loc, } // If the anchor is a custom directive, make sure at least one of its // arguments is a bound parameter. - if (auto custom = dyn_cast(anchor)) { - auto bound = llvm::find_if(custom->getArguments(), [](FormatElement *el) { - return isa(el); - }); + if (auto *custom = dyn_cast(anchor)) { + const auto *bound = + llvm::find_if(custom->getArguments(), [](FormatElement *el) { + return isa(el); + }); if (bound == custom->getArguments().end()) return emitError(loc, "`custom` directive with no bound parameters " "cannot be used as optional group anchor");