Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/lib/Dialect/Test/TestOps.td
Show First 20 Lines • Show All 2,177 Lines • ▼ Show 20 Lines | def FormatOptionalUnitAttrNoElide | ||||
let assemblyFormat = "($is_optional^)? attr-dict"; | let assemblyFormat = "($is_optional^)? attr-dict"; | ||||
} | } | ||||
def FormatOptionalEnumAttr : TEST_Op<"format_optional_enum_attr"> { | def FormatOptionalEnumAttr : TEST_Op<"format_optional_enum_attr"> { | ||||
let arguments = (ins OptionalAttr<SomeI64Enum>:$attr); | let arguments = (ins OptionalAttr<SomeI64Enum>:$attr); | ||||
let assemblyFormat = "($attr^)? attr-dict"; | let assemblyFormat = "($attr^)? attr-dict"; | ||||
} | } | ||||
def FormatOptionalDefaultAttr : TEST_Op<"format_optional_default_attr"> { | |||||
let arguments = (ins DefaultValuedAttr<StrAttr, "\"default\"">:$attr); | |||||
Mogball: there's a DefaultValuedStrAttr that lets you drop the quotes | |||||
let assemblyFormat = "($attr^)? attr-dict"; | |||||
} | |||||
def FormatOptionalWithElse : TEST_Op<"format_optional_else"> { | def FormatOptionalWithElse : TEST_Op<"format_optional_else"> { | ||||
let arguments = (ins UnitAttr:$isFirstBranchPresent); | let arguments = (ins UnitAttr:$isFirstBranchPresent); | ||||
let assemblyFormat = "(`then` $isFirstBranchPresent^):(`else`)? attr-dict"; | let assemblyFormat = "(`then` $isFirstBranchPresent^):(`else`)? attr-dict"; | ||||
} | } | ||||
def FormatCompoundAttr : TEST_Op<"format_compound_attr"> { | def FormatCompoundAttr : TEST_Op<"format_compound_attr"> { | ||||
let arguments = (ins CompoundAttrA:$compound); | let arguments = (ins CompoundAttrA:$compound); | ||||
let assemblyFormat = "$compound attr-dict-with-keyword"; | let assemblyFormat = "$compound attr-dict-with-keyword"; | ||||
▲ Show 20 Lines • Show All 894 Lines • Show Last 20 Lines |
there's a DefaultValuedStrAttr that lets you drop the quotes