[Mlir-commits] [mlir] [mlir] Improve doc in `OpFormatGen.cpp` (NFC) (PR #117564)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Nov 25 06:45:10 PST 2024
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 809c5ac3b0d78f504d93717ac4c0a02816cf47bb e5a29ce13f5b89f3c292b9697325091ab3274afb --extensions cpp -- mlir/tools/mlir-tblgen/OpFormatGen.cpp
``````````
</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 03929eaaf5..097a578cb2 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -2034,7 +2034,8 @@ static void genPropDictPrinter(OperationFormat &fmt, Operator &op,
body << " elidedProps.push_back(\"" << namedAttr->name << "\");\n";
// Add code to check attributes for equality with their default values.
- // Default-valued attributes will not be printed when their value matches the default.
+ // Default-valued attributes will not be printed when their value matches the
+ // default.
for (const NamedAttribute &namedAttr : op.getAttributes()) {
const Attribute &attr = namedAttr.attr;
if (!attr.isDerivedAttr() && attr.hasDefaultValue()) {
@@ -2080,9 +2081,10 @@ static void genAttrDictPrinter(OperationFormat &fmt, Operator &op,
body << " elidedAttrs.push_back(\"" << key << "\");\n";
for (const NamedAttribute *attr : fmt.usedAttributes)
body << " elidedAttrs.push_back(\"" << attr->name << "\");\n";
-
+
// Add code to check attributes for equality with their default values.
- // Default-valued attributes will not be printed when their value matches the default.
+ // Default-valued attributes will not be printed when their value matches the
+ // default.
for (const NamedAttribute &namedAttr : op.getAttributes()) {
const Attribute &attr = namedAttr.attr;
if (!attr.isDerivedAttr() && attr.hasDefaultValue()) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/117564
More information about the Mlir-commits
mailing list