[Mlir-commits] [mlir] [mlir][PDL] Use free-function cast for derived PDL values (PR #212212)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jul 27 02:40:38 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions inc,cpp -- mlir/include/mlir/IR/PDLPatternMatch.h.inc mlir/unittests/IR/PatternMatchTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/include/mlir/IR/PDLPatternMatch.h.inc b/mlir/include/mlir/IR/PDLPatternMatch.h.inc
index 10b397bdb..33cb1e4f7 100644
--- a/mlir/include/mlir/IR/PDLPatternMatch.h.inc
+++ b/mlir/include/mlir/IR/PDLPatternMatch.h.inc
@@ -461,9 +461,7 @@ struct ProcessDerivedPDLValue : public ProcessPDLValueBasedOn<T, BaseT> {
}
using ProcessPDLValueBasedOn<T, BaseT>::verifyAsArg;
- static T processAsArg(BaseT baseValue) {
- return mlir::cast<T>(baseValue);
- }
+ static T processAsArg(BaseT baseValue) { return mlir::cast<T>(baseValue); }
using ProcessPDLValueBasedOn<T, BaseT>::processAsArg;
static void processAsResult(PatternRewriter &, PDLResultList &results,
diff --git a/mlir/unittests/IR/PatternMatchTest.cpp b/mlir/unittests/IR/PatternMatchTest.cpp
index 453e4eb8a..a7d26b2f4 100644
--- a/mlir/unittests/IR/PatternMatchTest.cpp
+++ b/mlir/unittests/IR/PatternMatchTest.cpp
@@ -51,7 +51,7 @@ TEST(AnOpRewritePatternTest, PatternFuncAttributes) {
}
ShapedType rewriteShapedType(PatternRewriter & /*rewriter*/, ShapedType type,
- IntegerAttr /*rank*/) {
+ IntegerAttr /*rank*/) {
return type;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/212212
More information about the Mlir-commits
mailing list