Files
gps/tools/local/circt/include/mlir/Dialect/UB/IR/UBOpsAttributes.cpp.inc
T
2026-07-12 11:01:51 +03:00

75 lines
2.6 KiB
C++

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* AttrDef Definitions *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifdef GET_ATTRDEF_LIST
#undef GET_ATTRDEF_LIST
::mlir::ub::PoisonAttr
#endif // GET_ATTRDEF_LIST
#ifdef GET_ATTRDEF_CLASSES
#undef GET_ATTRDEF_CLASSES
static ::mlir::OptionalParseResult generatedAttributeParser(::mlir::AsmParser &parser, ::llvm::StringRef *mnemonic, ::mlir::Type type, ::mlir::Attribute &value) {
return ::mlir::AsmParser::KeywordSwitch<::mlir::OptionalParseResult>(parser)
.Case(::mlir::ub::PoisonAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
value = ::mlir::ub::PoisonAttr::get(parser.getContext());
return ::mlir::success(!!value);
})
.Default([&](llvm::StringRef keyword, llvm::SMLoc) {
*mnemonic = keyword;
return std::nullopt;
});
}
static ::llvm::LogicalResult generatedAttributePrinter(::mlir::Attribute def, ::mlir::AsmPrinter &printer) {
return ::llvm::TypeSwitch<::mlir::Attribute, ::llvm::LogicalResult>(def) .Case<::mlir::ub::PoisonAttr>([&](auto t) {
printer << ::mlir::ub::PoisonAttr::getMnemonic();
return ::mlir::success();
})
.Default([](auto) { return ::mlir::failure(); });
}
namespace mlir::ub {
} // namespace mlir::ub
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::ub::PoisonAttr)
namespace mlir::ub {
/// Parse an attribute registered to this dialect.
::mlir::Attribute UBDialect::parseAttribute(::mlir::DialectAsmParser &parser,
::mlir::Type type) const {
::llvm::SMLoc typeLoc = parser.getCurrentLocation();
::llvm::StringRef attrTag;
{
::mlir::Attribute attr;
auto parseResult = generatedAttributeParser(parser, &attrTag, type, attr);
if (parseResult.has_value())
return attr;
}
parser.emitError(typeLoc) << "unknown attribute `"
<< attrTag << "` in dialect `" << getNamespace() << "`";
return {};
}
/// Print an attribute registered to this dialect.
void UBDialect::printAttribute(::mlir::Attribute attr,
::mlir::DialectAsmPrinter &printer) const {
if (::mlir::succeeded(generatedAttributePrinter(attr, printer)))
return;
}
} // namespace mlir::ub
#endif // GET_ATTRDEF_CLASSES