[Mlir-commits] [mlir] 2e9cd81 - Apply clang-tidy fixes for llvm-qualified-auto in AttrOrTypeFormatGen.cpp (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Sun Nov 13 21:16:38 PST 2022
Author: Mehdi Amini
Date: 2022-11-14T05:16:15Z
New Revision: 2e9cd81d3fd08aa52b645946b4235f1112170333
URL: https://github.com/llvm/llvm-project/commit/2e9cd81d3fd08aa52b645946b4235f1112170333
DIFF: https://github.com/llvm/llvm-project/commit/2e9cd81d3fd08aa52b645946b4235f1112170333.diff
LOG: Apply clang-tidy fixes for llvm-qualified-auto in AttrOrTypeFormatGen.cpp (NFC)
Added:
Modified:
mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
Removed:
################################################################################
diff --git a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
index da2455b690b5..0469b28ba12e 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<CustomDirective>(el)) {
for (FormatElement *el : custom->getArguments()) {
// If the custom argument is a variable, then it must be optional.
- if (auto param = dyn_cast<ParameterElement>(el))
+ if (auto *param = dyn_cast<ParameterElement>(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<CustomDirective>(anchor)) {
- auto bound = llvm::find_if(custom->getArguments(), [](FormatElement *el) {
- return isa<ParameterElement>(el);
- });
+ if (auto *custom = dyn_cast<CustomDirective>(anchor)) {
+ const auto *bound =
+ llvm::find_if(custom->getArguments(), [](FormatElement *el) {
+ return isa<ParameterElement>(el);
+ });
if (bound == custom->getArguments().end())
return emitError(loc, "`custom` directive with no bound parameters "
"cannot be used as optional group anchor");
More information about the Mlir-commits
mailing list