[Mlir-commits] [mlir] Enable printing newlines and indents in attribute and type printers (PR #87948)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 2 19:09:33 PST 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 cpp,h -- mlir/include/mlir/IR/OpImplementation.h mlir/lib/IR/AsmPrinter.cpp mlir/test/lib/Dialect/Test/TestAttributes.cpp mlir/test/lib/Dialect/Test/TestTypes.cpp mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.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/test/lib/Dialect/Test/TestAttributes.cpp b/mlir/test/lib/Dialect/Test/TestAttributes.cpp
index a7e7c1566..9e20a95c1 100644
--- a/mlir/test/lib/Dialect/Test/TestAttributes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestAttributes.cpp
@@ -460,7 +460,8 @@ bool TestConstMemorySpaceAttr::isValidPtrIntCast(
 Attribute TestAttrNewlineAndIndentAttr::parse(::mlir::AsmParser &parser,
                                               ::mlir::Type type) {
   Type indentType;
-  if (parser.parseLess() || parser.parseType(indentType) || parser.parseGreater()) {
+  if (parser.parseLess() || parser.parseType(indentType) ||
+      parser.parseGreater()) {
     return Attribute();
   }
   return get(parser.getContext(), indentType);
diff --git a/mlir/test/lib/Dialect/Test/TestTypes.cpp b/mlir/test/lib/Dialect/Test/TestTypes.cpp
index db716ca13..71dd25b00 100644
--- a/mlir/test/lib/Dialect/Test/TestTypes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestTypes.cpp
@@ -589,7 +589,8 @@ TestTensorType::getBufferType(
 //===----------------------------------------------------------------------===//
 
 Type TestTypeNewlineAndIndentType::parse(::mlir::AsmParser &parser) {
-  if (parser.parseLess() || parser.parseKeyword("indented_content") || parser.parseGreater()) {
+  if (parser.parseLess() || parser.parseKeyword("indented_content") ||
+      parser.parseGreater()) {
     return Type();
   }
   return get(parser.getContext());

``````````

</details>


https://github.com/llvm/llvm-project/pull/87948


More information about the Mlir-commits mailing list