Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions mlir/tools/mlir-tblgen/OpFormatGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2033,8 +2033,9 @@ static void genPropDictPrinter(OperationFormat &fmt, Operator &op,
for (const NamedAttribute *namedAttr : fmt.usedAttributes)
body << " elidedProps.push_back(\"" << namedAttr->name << "\");\n";

// Add code to check attributes for equality with the default value
// for attributes with the elidePrintingDefaultValue bit set.
// Add code to check attributes for equality with their default values.
// 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()) {
Expand Down Expand Up @@ -2080,8 +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 the default value
// for attributes with the elidePrintingDefaultValue bit set.

// Add code to check attributes for equality with their default values.
// 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()) {
Expand Down
Loading