10#undef GET_TYPEDEF_LIST
16#ifdef GET_TYPEDEF_CLASSES
17#undef GET_TYPEDEF_CLASSES
19static ::mlir::OptionalParseResult generatedTypeParser(::mlir::AsmParser &parser, ::llvm::StringRef *mnemonic, ::mlir::Type &value) {
20 return ::mlir::AsmParser::KeywordSwitch<::mlir::OptionalParseResult>(parser)
23 return ::mlir::success(!!value);
25 .Default([&](llvm::StringRef keyword, llvm::SMLoc) {
31static ::llvm::LogicalResult generatedTypePrinter(::mlir::Type def, ::mlir::AsmPrinter &printer) {
32 return ::llvm::TypeSwitch<::mlir::Type, ::llvm::LogicalResult>(def) .Case<
::llzk::felt::FeltType>([&](
auto t) {
35 return ::mlir::success();
37 .Default([](
auto) { return ::mlir::failure(); });
44 using KeyTy = std::tuple<::mlir::StringAttr>;
52 return (
fieldName == std::get<0>(tblgenKey));
56 return ::llvm::hash_combine(std::get<0>(tblgenKey));
60 auto fieldName = std::move(std::get<0>(tblgenKey));
68 return Base::get(context, std::move(fieldName));
71FeltType FeltType::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::mlir::StringAttr fieldName) {
72 return Base::getChecked(emitError, context, fieldName);
76 return Base::get(context, ::mlir::StringAttr());
80 return Base::getChecked(emitError, context, ::mlir::StringAttr());
84 return Base::get(context, ::mlir::StringAttr::get(context, fieldName));
87FeltType FeltType::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::StringRef fieldName) {
88 return Base::getChecked(emitError, context, ::mlir::StringAttr::get(context, fieldName));
91::llvm::LogicalResult
FeltType::verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::StringAttr fieldName) {
92 if (::mlir::failed(
verify(emitError, fieldName)))
93 return ::mlir::failure();
94 return ::mlir::success();
98 ::mlir::Builder odsBuilder(odsParser.getContext());
99 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
101 ::mlir::FailureOr<::mlir::StringAttr> _result_fieldName;
103 if (odsParser.parseOptionalLess()) {
108 if (::mlir::failed(_result_fieldName)) {
109 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse LLZK_FeltType parameter 'fieldName' which is to be a `::mlir::StringAttr`");
113 if (odsParser.parseGreater())
return {};
115 return odsParser.getChecked<
FeltType>(odsLoc, odsParser.getContext(),
116 ::mlir::StringAttr((_result_fieldName.value_or(::mlir::StringAttr()))));
120 ::mlir::Builder odsBuilder(getContext());
132 return getImpl()->fieldName;
143 ::llvm::SMLoc typeLoc = parser.getCurrentLocation();
144 ::llvm::StringRef mnemonic;
145 ::mlir::Type genType;
146 auto parseResult = generatedTypeParser(parser, &mnemonic, genType);
147 if (parseResult.has_value())
150 parser.emitError(typeLoc) <<
"unknown type `"
151 << mnemonic <<
"` in dialect `" << getNamespace() <<
"`";
156 ::mlir::DialectAsmPrinter &printer)
const {
157 if (::mlir::succeeded(generatedTypePrinter(type, printer)))
void printType(::mlir::Type type, ::mlir::DialectAsmPrinter &os) const override
Print a type registered to this dialect.
::mlir::Type parseType(::mlir::DialectAsmParser &parser) const override
Parse a type registered to this dialect.
static constexpr ::llvm::StringLiteral getMnemonic()
::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::StringAttr fieldName)
static FeltType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::mlir::StringAttr fieldName)
::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::StringAttr fieldName)
::mlir::StringAttr getFieldName() const
::mlir::Type parse(::mlir::AsmParser &odsParser)
void print(::mlir::AsmPrinter &odsPrinter) const
static FeltType get(::mlir::MLIRContext *context, ::mlir::StringAttr fieldName)
FeltTypeStorage(::mlir::StringAttr fieldName)
::llvm::hash_code hashKey(const KeyTy &tblgenKey)
std::tuple<::mlir::StringAttr > KeyTy
::mlir::StringAttr fieldName
static FeltTypeStorage * construct(::mlir::TypeStorageAllocator &allocator, KeyTy &&tblgenKey)
bool operator==(const KeyTy &tblgenKey) const