[Mlir-commits] [mlir] [mlir][ODS] Share parser operand storage cleanup (NFC) (PR #226094)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 24 03:04:25 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 h,cpp -- mlir/include/mlir/IR/OpImplementation.h mlir/tools/mlir-tblgen/OpFormatGen.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/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index 81269c90a..0e35716d7 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -16,10 +16,10 @@
 #include "mlir/TableGen/Operator.h"
 #include "mlir/TableGen/Trait.h"
 #include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Sequence.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallBitVector.h"
-#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/ADT/TypeSwitch.h"
@@ -1009,9 +1009,9 @@ static void genElementParserStorage(FormatElement *element, const Operator &op,
         body << "  auto &" << name << "Operands = odsOperandVectors[" << index
              << "];\n";
       } else {
-        body
-            << "  ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> "
-            << name << "Operands;\n";
+        body << "  ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, "
+                "4> "
+             << name << "Operands;\n";
       }
       if (operand->getVar()->isVariadicOfVariadic()) {
         body << "    llvm::SmallVector<int32_t> " << name
@@ -1843,8 +1843,8 @@ void OperationFormat::genParser(Operator &op, OpClass &opClass) {
   // Generate variables to store the operands and type within the format. This
   // allows for referencing these variables in the presence of optional
   // groupings.
-  unsigned numVariableLengthOperands = llvm::count_if(
-      op.getOperands(), [](const NamedTypeConstraint &operand) {
+  unsigned numVariableLengthOperands =
+      llvm::count_if(op.getOperands(), [](const NamedTypeConstraint &operand) {
         return operand.isVariableLength();
       });
   bool groupOperandStorage = !allOperands && numVariableLengthOperands > 1;

``````````

</details>


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


More information about the Mlir-commits mailing list