15 #include "llvm/ADT/Twine.h"
16 #include "llvm/ADT/TypeSwitch.h"
17 #include "llvm/TableGen/Record.h"
27 return def->isSubClassOf(
"Optional");
31 return def->isSubClassOf(
"Variadic");
35 return def->isSubClassOf(
"VariadicOfVariadic");
40 return def->getValueAsString(
"segmentAttrName");
46 const Record *baseType =
def;
48 baseType = baseType->getValueAsDef(
"baseType");
51 const llvm::RecordVal *builderCall = baseType->getValue(
"builderCall");
52 if (!builderCall || !builderCall->getValue())
55 builderCall->getValue())
56 .Case<llvm::StringInit>([&](
auto *init) {
57 StringRef value = init->getValue();
58 return value.empty() ? std::optional<StringRef>() : value;
60 .Default([](
auto *) {
return std::nullopt; });
65 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.