10#undef GET_ATTRDEF_LIST
12::llzk::function::AllowConstraintAttr,
13::llzk::function::AllowWitnessAttr
17#ifdef GET_ATTRDEF_CLASSES
18#undef GET_ATTRDEF_CLASSES
20static ::mlir::OptionalParseResult generatedAttributeParser(::mlir::AsmParser &parser, ::llvm::StringRef *mnemonic, ::mlir::Type type, ::mlir::Attribute &value) {
21 return ::mlir::AsmParser::KeywordSwitch<::mlir::OptionalParseResult>(parser)
22 .Case(::llzk::function::AllowConstraintAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
23 value = ::llzk::function::AllowConstraintAttr::get(parser.getContext());
24 return ::mlir::success(!!value);
26 .Case(::llzk::function::AllowWitnessAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
27 value = ::llzk::function::AllowWitnessAttr::get(parser.getContext());
28 return ::mlir::success(!!value);
30 .Default([&](llvm::StringRef keyword, llvm::SMLoc) {
36static ::mlir::LogicalResult generatedAttributePrinter(::mlir::Attribute def, ::mlir::AsmPrinter &printer) {
37 return ::llvm::TypeSwitch<::mlir::Attribute, ::mlir::LogicalResult>(def) .Case<::llzk::function::AllowConstraintAttr>([&](
auto t) {
38 printer << ::llzk::function::AllowConstraintAttr::getMnemonic();
39 return ::mlir::success();
41 .Case<::llzk::function::AllowWitnessAttr>([&](
auto t) {
42 printer << ::llzk::function::AllowWitnessAttr::getMnemonic();
43 return ::mlir::success();
45 .Default([](
auto) { return ::mlir::failure(); });
52MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::function::AllowConstraintAttr)
57MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::function::AllowWitnessAttr)
63 ::mlir::Type type)
const {
64 ::llvm::SMLoc typeLoc = parser.getCurrentLocation();
65 ::llvm::StringRef attrTag;
67 ::mlir::Attribute attr;
68 auto parseResult = generatedAttributeParser(parser, &attrTag, type, attr);
69 if (parseResult.has_value())
73 parser.emitError(typeLoc) <<
"unknown attribute `"
74 << attrTag <<
"` in dialect `" << getNamespace() <<
"`";
79 ::mlir::DialectAsmPrinter &printer)
const {
80 if (::mlir::succeeded(generatedAttributePrinter(attr, printer)))
::mlir::Attribute parseAttribute(::mlir::DialectAsmParser &parser, ::mlir::Type type) const override
Parse an attribute registered to this dialect.
void printAttribute(::mlir::Attribute attr, ::mlir::DialectAsmPrinter &os) const override
Print an attribute registered to this dialect.