15 #include "llvm/ADT/TypeSwitch.h"
16 #include "llvm/TableGen/Record.h"
26 return def->isSubClassOf(
"Optional");
30 return def->isSubClassOf(
"Variadic");
34 return def->isSubClassOf(
"VariadicOfVariadic");
39 return def->getValueAsString(
"segmentAttrName");
45 const Record *baseType =
def;
47 baseType = baseType->getValueAsDef(
"baseType");
50 const llvm::RecordVal *builderCall = baseType->getValue(
"builderCall");
51 if (!builderCall || !builderCall->getValue())
54 builderCall->getValue())
55 .Case<llvm::StringInit>([&](
auto *init) {
56 StringRef value = init->getValue();
57 return value.empty() ? std::optional<StringRef>() : value;
59 .Default([](
auto *) {
return std::nullopt; });
64 return def->getValueAsString(
"cppType");
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
TypeConstraint(const llvm::DefInit *record)
StringRef getVariadicOfVariadicSegmentSizeAttr() const
StringRef getCppType() const
bool isVariableLength() const
std::optional< StringRef > getBuilderCall() const
bool isVariadicOfVariadic() const
Dialect getDialect() const
Type(const llvm::Record *record)
Include the generated interface declarations.