10#undef GET_ATTRDEF_LIST
12::llzk::smt_info::KeywordAttr,
13::llzk::smt_info::SymbolAttr
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::smt_info::KeywordAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
23 value = ::llzk::smt_info::KeywordAttr::parse(parser, type);
24 return ::mlir::success(!!value);
26 .Case(::llzk::smt_info::SymbolAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
27 value = ::llzk::smt_info::SymbolAttr::parse(parser, type);
28 return ::mlir::success(!!value);
30 .Default([&](llvm::StringRef keyword, llvm::SMLoc) {
36static ::llvm::LogicalResult generatedAttributePrinter(::mlir::Attribute def, ::mlir::AsmPrinter &printer) {
37 return ::llvm::TypeSwitch<::mlir::Attribute, ::llvm::LogicalResult>(def) .Case<::llzk::smt_info::KeywordAttr>([&](
auto t) {
38 printer << ::llzk::smt_info::KeywordAttr::getMnemonic();
40 return ::mlir::success();
42 .Case<::llzk::smt_info::SymbolAttr>([&](
auto t) {
43 printer << ::llzk::smt_info::SymbolAttr::getMnemonic();
45 return ::mlir::success();
47 .Default([](
auto) { return ::mlir::failure(); });
54struct KeywordAttrStorage :
public ::mlir::AttributeStorage {
55 using KeyTy = std::tuple<::llvm::StringRef>;
56 KeywordAttrStorage(::llvm::StringRef value) : value(std::move(value)) {}
58 KeyTy getAsKey()
const {
62 bool operator==(
const KeyTy &tblgenKey)
const {
63 return (value == std::get<0>(tblgenKey));
66 static ::llvm::hash_code hashKey(
const KeyTy &tblgenKey) {
67 return ::llvm::hash_combine(std::get<0>(tblgenKey));
70 static KeywordAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
71 auto value = std::move(std::get<0>(tblgenKey));
72 value = allocator.copyInto(value);
73 return new (allocator.allocate<KeywordAttrStorage>()) KeywordAttrStorage(std::move(value));
76 ::llvm::StringRef value;
80KeywordAttr KeywordAttr::get(::mlir::MLIRContext *context, ::llvm::StringRef value) {
81 return Base::get(context, std::move(value));
84KeywordAttr KeywordAttr::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::StringRef value) {
85 return Base::getChecked(emitError, context, std::move(value));
88::llvm::LogicalResult KeywordAttr::verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::StringRef value) {
89 if (::mlir::failed(verify(emitError, value)))
90 return ::mlir::failure();
91 return ::mlir::success();
94::llvm::StringRef KeywordAttr::getValue()
const {
95 return getImpl()->value;
100MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::smt_info::KeywordAttr)
105struct SymbolAttrStorage :
public ::mlir::AttributeStorage {
106 using KeyTy = std::tuple<::llvm::StringRef>;
107 SymbolAttrStorage(::llvm::StringRef value) : value(std::move(value)) {}
109 KeyTy getAsKey()
const {
113 bool operator==(
const KeyTy &tblgenKey)
const {
114 return (value == std::get<0>(tblgenKey));
117 static ::llvm::hash_code hashKey(
const KeyTy &tblgenKey) {
118 return ::llvm::hash_combine(std::get<0>(tblgenKey));
121 static SymbolAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
122 auto value = std::move(std::get<0>(tblgenKey));
123 value = allocator.copyInto(value);
124 return new (allocator.allocate<SymbolAttrStorage>()) SymbolAttrStorage(std::move(value));
127 ::llvm::StringRef value;
131SymbolAttr SymbolAttr::get(::mlir::MLIRContext *context, ::llvm::StringRef value) {
132 return Base::get(context, std::move(value));
135SymbolAttr SymbolAttr::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::StringRef value) {
136 return Base::getChecked(emitError, context, std::move(value));
139::llvm::LogicalResult SymbolAttr::verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::StringRef value) {
140 if (::mlir::failed(verify(emitError, value)))
141 return ::mlir::failure();
142 return ::mlir::success();
145::llvm::StringRef SymbolAttr::getValue()
const {
146 return getImpl()->value;
151MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::smt_info::SymbolAttr)
157 ::mlir::Type type)
const {
158 ::llvm::SMLoc typeLoc = parser.getCurrentLocation();
159 ::llvm::StringRef attrTag;
161 ::mlir::Attribute attr;
162 auto parseResult = generatedAttributeParser(parser, &attrTag, type, attr);
163 if (parseResult.has_value())
167 parser.emitError(typeLoc) <<
"unknown attribute `"
168 << attrTag <<
"` in dialect `" << getNamespace() <<
"`";
173 ::mlir::DialectAsmPrinter &printer)
const {
174 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.