10#undef GET_TYPEDEF_LIST
21#ifdef GET_TYPEDEF_CLASSES
22#undef GET_TYPEDEF_CLASSES
24static ::mlir::OptionalParseResult generatedTypeParser(::mlir::AsmParser &parser, ::llvm::StringRef *mnemonic, ::mlir::Type &value) {
25 return ::mlir::AsmParser::KeywordSwitch<::mlir::OptionalParseResult>(parser)
28 return ::mlir::success(!!value);
32 return ::mlir::success(!!value);
36 return ::mlir::success(!!value);
40 return ::mlir::success(!!value);
44 return ::mlir::success(!!value);
48 return ::mlir::success(!!value);
50 .Default([&](llvm::StringRef keyword, llvm::SMLoc) {
56static ::llvm::LogicalResult generatedTypePrinter(::mlir::Type def, ::mlir::AsmPrinter &printer) {
57 return ::llvm::TypeSwitch<::mlir::Type, ::llvm::LogicalResult>(def) .Case<
::llzk::smt::BoolType>([&](
auto t) {
60 return ::mlir::success();
62 .Case<::llzk::smt::IntType>([&](
auto t) {
65 return ::mlir::success();
67 .Case<::llzk::smt::BitVectorType>([&](
auto t) {
70 return ::mlir::success();
72 .Case<::llzk::smt::ArrayType>([&](
auto t) {
75 return ::mlir::success();
77 .Case<::llzk::smt::SMTFuncType>([&](
auto t) {
80 return ::mlir::success();
82 .Case<::llzk::smt::SortType>([&](
auto t) {
85 return ::mlir::success();
87 .Default([](
auto) { return ::mlir::failure(); });
93 ::mlir::Builder odsBuilder(odsParser.getContext());
94 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
96 return BoolType::get(odsParser.getContext());
100 ::mlir::Builder odsBuilder(getContext());
109 ::mlir::Builder odsBuilder(odsParser.getContext());
110 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
112 return IntType::get(odsParser.getContext());
116 ::mlir::Builder odsBuilder(getContext());
134 return (
width == std::get<0>(tblgenKey));
138 return ::llvm::hash_combine(std::get<0>(tblgenKey));
142 auto width = std::move(std::get<0>(tblgenKey));
150 return Base::get(context, std::move(width));
154 return Base::getChecked(emitError, context, width);
158 if (::mlir::failed(
verify(emitError, width)))
159 return ::mlir::failure();
160 return ::mlir::success();
164 ::mlir::Builder odsBuilder(odsParser.getContext());
165 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
167 ::mlir::FailureOr<int64_t> _result_width;
169 if (odsParser.parseLess())
return {};
173 if (::mlir::failed(_result_width)) {
174 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse BitVectorType parameter 'width' which is to be a `int64_t`");
178 if (odsParser.parseGreater())
return {};
179 assert(::mlir::succeeded(_result_width));
180 return odsParser.getChecked<
BitVectorType>(odsLoc, odsParser.getContext(),
181 int64_t((*_result_width)));
185 ::mlir::Builder odsBuilder(getContext());
187 odsPrinter.printStrippedAttrOrType(
getWidth());
192 return getImpl()->width;
202 using KeyTy = std::tuple<mlir::Type, mlir::Type>;
214 return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey));
218 auto domainType = std::move(std::get<0>(tblgenKey));
219 auto rangeType = std::move(std::get<1>(tblgenKey));
228 return Base::get(context, std::move(domainType), std::move(rangeType));
231ArrayType ArrayType::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, mlir::Type domainType, mlir::Type rangeType) {
232 return Base::getChecked(emitError, context, domainType, rangeType);
235::llvm::LogicalResult
ArrayType::verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, mlir::Type domainType, mlir::Type rangeType) {
236 if (::mlir::failed(
verify(emitError, domainType, rangeType)))
237 return ::mlir::failure();
238 return ::mlir::success();
242 ::mlir::Builder odsBuilder(odsParser.getContext());
243 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
245 ::mlir::FailureOr<mlir::Type> _result_domainType;
246 ::mlir::FailureOr<mlir::Type> _result_rangeType;
248 if (odsParser.parseLess())
return {};
250 if (odsParser.parseLSquare())
return {};
254 if (::mlir::failed(_result_domainType)) {
255 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse ArrayType parameter 'domainType' which is to be a `mlir::Type`");
259 if (odsParser.parseArrow())
return {};
263 if (::mlir::failed(_result_rangeType)) {
264 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse ArrayType parameter 'rangeType' which is to be a `mlir::Type`");
268 if (odsParser.parseRSquare())
return {};
270 if (odsParser.parseGreater())
return {};
271 assert(::mlir::succeeded(_result_domainType));
272 assert(::mlir::succeeded(_result_rangeType));
273 return odsParser.getChecked<
ArrayType>(odsLoc, odsParser.getContext(),
274 mlir::Type((*_result_domainType)),
275 mlir::Type((*_result_rangeType)));
279 ::mlir::Builder odsBuilder(getContext());
283 odsPrinter <<
' ' <<
"->";
291 return getImpl()->domainType;
295 return getImpl()->rangeType;
305 using KeyTy = std::tuple<::llvm::ArrayRef<mlir::Type>, mlir::Type>;
317 return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey));
321 auto domainTypes = std::move(std::get<0>(tblgenKey));
322 auto rangeType = std::move(std::get<1>(tblgenKey));
332 return Base::get(context, std::move(domainTypes), std::move(rangeType));
335SMTFuncType SMTFuncType::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::ArrayRef<mlir::Type> domainTypes, mlir::Type rangeType) {
336 return Base::getChecked(emitError, context, domainTypes, rangeType);
340 return Base::get(rangeType.getContext(), domainTypes, rangeType);
344 return Base::getChecked(emitError, rangeType.getContext(), domainTypes, rangeType);
348 return Base::get(rangeType.getContext(),
349 llvm::ArrayRef<mlir::Type>{}, rangeType);
353 return Base::getChecked(emitError, rangeType.getContext(),
354 llvm::ArrayRef<mlir::Type>{}, rangeType);
357::llvm::LogicalResult
SMTFuncType::verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef<mlir::Type> domainTypes, mlir::Type rangeType) {
358 if (::mlir::failed(
verify(emitError, domainTypes, rangeType)))
359 return ::mlir::failure();
360 return ::mlir::success();
364 ::mlir::Builder odsBuilder(odsParser.getContext());
365 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
367 ::mlir::FailureOr<::llvm::SmallVector<mlir::Type>> _result_domainTypes;
368 ::mlir::FailureOr<mlir::Type> _result_rangeType;
370 if (odsParser.parseLess())
return {};
372 if (odsParser.parseLParen())
return {};
376 if (::mlir::failed(_result_domainTypes)) {
377 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse SMTFuncType parameter 'domainTypes' which is to be a `::llvm::ArrayRef<mlir::Type>`");
381 if (odsParser.parseRParen())
return {};
385 if (::mlir::failed(_result_rangeType)) {
386 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse SMTFuncType parameter 'rangeType' which is to be a `mlir::Type`");
390 if (odsParser.parseGreater())
return {};
391 assert(::mlir::succeeded(_result_domainTypes));
392 assert(::mlir::succeeded(_result_rangeType));
393 return odsParser.getChecked<
SMTFuncType>(odsLoc, odsParser.getContext(),
394 ::llvm::ArrayRef<mlir::Type>((*_result_domainTypes)),
395 mlir::Type((*_result_rangeType)));
399 ::mlir::Builder odsBuilder(getContext());
410 return getImpl()->domainTypes;
414 return getImpl()->rangeType;
424 using KeyTy = std::tuple<mlir::StringAttr, ::llvm::ArrayRef<mlir::Type>>;
432 return (
identifier == std::get<0>(tblgenKey)) && (::llvm::ArrayRef<mlir::Type>(
sortParams) == ::llvm::ArrayRef<mlir::Type>(std::get<1>(tblgenKey)));
436 return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey));
440 auto identifier = std::move(std::get<0>(tblgenKey));
441 auto sortParams = std::move(std::get<1>(tblgenKey));
450SortType SortType::get(::mlir::MLIRContext *context, mlir::StringAttr identifier, ::llvm::ArrayRef<mlir::Type> sortParams) {
451 return Base::get(context, std::move(identifier), std::move(sortParams));
454SortType SortType::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, mlir::StringAttr identifier, ::llvm::ArrayRef<mlir::Type> sortParams) {
455 return Base::getChecked(emitError, context, identifier, sortParams);
458SortType SortType::get(::mlir::MLIRContext *context, llvm::StringRef identifier, llvm::ArrayRef<mlir::Type> sortParams) {
459 return Base::get(context, mlir::StringAttr::get(context, identifier),
463SortType SortType::getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, llvm::StringRef identifier, llvm::ArrayRef<mlir::Type> sortParams) {
464 return Base::getChecked(emitError, context, mlir::StringAttr::get(context, identifier),
469 return Base::get(context, mlir::StringAttr::get(context, identifier),
470 llvm::ArrayRef<mlir::Type>{});
474 return Base::getChecked(emitError, context, mlir::StringAttr::get(context, identifier),
475 llvm::ArrayRef<mlir::Type>{});
478::llvm::LogicalResult
SortType::verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, mlir::StringAttr identifier, ::llvm::ArrayRef<mlir::Type> sortParams) {
479 if (::mlir::failed(
verify(emitError, identifier, sortParams)))
480 return ::mlir::failure();
481 return ::mlir::success();
485 ::mlir::Builder odsBuilder(odsParser.getContext());
486 ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
488 ::mlir::FailureOr<mlir::StringAttr> _result_identifier;
489 ::mlir::FailureOr<::llvm::SmallVector<mlir::Type>> _result_sortParams;
491 if (odsParser.parseLess())
return {};
495 if (::mlir::failed(_result_identifier)) {
496 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse SortType parameter 'identifier' which is to be a `mlir::StringAttr`");
500 if (odsParser.parseOptionalLSquare()) {
505 if (::mlir::failed(_result_sortParams)) {
506 odsParser.emitError(odsParser.getCurrentLocation(),
"failed to parse SortType parameter 'sortParams' which is to be a `::llvm::ArrayRef<mlir::Type>`");
510 if (odsParser.parseRSquare())
return {};
513 if (odsParser.parseGreater())
return {};
514 assert(::mlir::succeeded(_result_identifier));
515 return odsParser.getChecked<
SortType>(odsLoc, odsParser.getContext(),
516 mlir::StringAttr((*_result_identifier)),
517 ::llvm::ArrayRef<mlir::Type>((_result_sortParams.value_or(::llvm::SmallVector<mlir::Type>()))));
521 ::mlir::Builder odsBuilder(getContext());
524 if (!(::llvm::ArrayRef<mlir::Type>(
getSortParams()) == ::llvm::ArrayRef<mlir::Type>(::llvm::SmallVector<mlir::Type>()))) {
526 if (!(::llvm::ArrayRef<mlir::Type>(
getSortParams()) == ::llvm::ArrayRef<mlir::Type>(::llvm::SmallVector<mlir::Type>()))) {
536 return getImpl()->identifier;
540 return getImpl()->sortParams;
551 ::llvm::SMLoc typeLoc = parser.getCurrentLocation();
552 ::llvm::StringRef mnemonic;
553 ::mlir::Type genType;
554 auto parseResult = generatedTypeParser(parser, &mnemonic, genType);
555 if (parseResult.has_value())
558 parser.emitError(typeLoc) <<
"unknown type `"
559 << mnemonic <<
"` in dialect `" << getNamespace() <<
"`";
564 ::mlir::DialectAsmPrinter &printer)
const {
565 if (::mlir::succeeded(generatedTypePrinter(type, printer)))
mlir::Type getDomainType() const
static ArrayType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, mlir::Type domainType, mlir::Type rangeType)
mlir::Type getRangeType() const
::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, mlir::Type domainType, mlir::Type rangeType)
::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, mlir::Type domainType, mlir::Type rangeType)
static constexpr ::llvm::StringLiteral getMnemonic()
void print(::mlir::AsmPrinter &odsPrinter) const
static ArrayType get(::mlir::MLIRContext *context, mlir::Type domainType, mlir::Type rangeType)
::mlir::Type parse(::mlir::AsmParser &odsParser)
static BitVectorType get(::mlir::MLIRContext *context, int64_t width)
void print(::mlir::AsmPrinter &odsPrinter) const
static constexpr ::llvm::StringLiteral getMnemonic()
::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int64_t width)
::mlir::Type parse(::mlir::AsmParser &odsParser)
static BitVectorType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, int64_t width)
::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int64_t width)
::mlir::Type parse(::mlir::AsmParser &odsParser)
void print(::mlir::AsmPrinter &odsPrinter) const
static constexpr ::llvm::StringLiteral getMnemonic()
void print(::mlir::AsmPrinter &odsPrinter) const
static constexpr ::llvm::StringLiteral getMnemonic()
::mlir::Type parse(::mlir::AsmParser &odsParser)
::mlir::Type parseType(::mlir::DialectAsmParser &parser) const override
Parse a type registered to this dialect.
void printType(::mlir::Type type, ::mlir::DialectAsmPrinter &os) const override
Print a type registered to this dialect.
void print(::mlir::AsmPrinter &odsPrinter) const
::llvm::ArrayRef< mlir::Type > getDomainTypes() const
::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef< mlir::Type > domainTypes, mlir::Type rangeType)
static SMTFuncType get(::mlir::MLIRContext *context, ::llvm::ArrayRef< mlir::Type > domainTypes, mlir::Type rangeType)
::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::llvm::ArrayRef< mlir::Type > domainTypes, mlir::Type rangeType)
mlir::Type getRangeType() const
static SMTFuncType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, ::llvm::ArrayRef< mlir::Type > domainTypes, mlir::Type rangeType)
::mlir::Type parse(::mlir::AsmParser &odsParser)
static constexpr ::llvm::StringLiteral getMnemonic()
::llvm::LogicalResult verifyInvariants(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, mlir::StringAttr identifier, ::llvm::ArrayRef< mlir::Type > sortParams)
static SortType getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, mlir::StringAttr identifier, ::llvm::ArrayRef< mlir::Type > sortParams)
::mlir::Type parse(::mlir::AsmParser &odsParser)
void print(::mlir::AsmPrinter &odsPrinter) const
static constexpr ::llvm::StringLiteral getMnemonic()
::llvm::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, mlir::StringAttr identifier, ::llvm::ArrayRef< mlir::Type > sortParams)
static SortType get(::mlir::MLIRContext *context, mlir::StringAttr identifier, ::llvm::ArrayRef< mlir::Type > sortParams)
mlir::StringAttr getIdentifier() const
::llvm::ArrayRef< mlir::Type > getSortParams() const
::llvm::hash_code hashKey(const KeyTy &tblgenKey)
std::tuple< mlir::Type, mlir::Type > KeyTy
ArrayTypeStorage(mlir::Type domainType, mlir::Type rangeType)
static ArrayTypeStorage * construct(::mlir::TypeStorageAllocator &allocator, KeyTy &&tblgenKey)
bool operator==(const KeyTy &tblgenKey) const
static BitVectorTypeStorage * construct(::mlir::TypeStorageAllocator &allocator, KeyTy &&tblgenKey)
BitVectorTypeStorage(int64_t width)
bool operator==(const KeyTy &tblgenKey) const
::llvm::hash_code hashKey(const KeyTy &tblgenKey)
std::tuple< int64_t > KeyTy
bool operator==(const KeyTy &tblgenKey) const
SMTFuncTypeStorage(::llvm::ArrayRef< mlir::Type > domainTypes, mlir::Type rangeType)
::llvm::hash_code hashKey(const KeyTy &tblgenKey)
::llvm::ArrayRef< mlir::Type > domainTypes
std::tuple<::llvm::ArrayRef< mlir::Type >, mlir::Type > KeyTy
static SMTFuncTypeStorage * construct(::mlir::TypeStorageAllocator &allocator, KeyTy &&tblgenKey)
static SortTypeStorage * construct(::mlir::TypeStorageAllocator &allocator, KeyTy &&tblgenKey)
::llvm::ArrayRef< mlir::Type > sortParams
bool operator==(const KeyTy &tblgenKey) const
::llvm::hash_code hashKey(const KeyTy &tblgenKey)
mlir::StringAttr identifier
SortTypeStorage(mlir::StringAttr identifier, ::llvm::ArrayRef< mlir::Type > sortParams)
std::tuple< mlir::StringAttr, ::llvm::ArrayRef< mlir::Type > > KeyTy