Changeset View
Changeset View
Standalone View
Standalone View
mlir/tools/mlir-tblgen/DialectGen.cpp
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | // Emit all nested namespaces. | ||||
std::string cppName = dialect.getCppClassName(); | std::string cppName = dialect.getCppClassName(); | ||||
os << llvm::formatv(dialectDeclBeginStr, cppName, dialect.getName(), | os << llvm::formatv(dialectDeclBeginStr, cppName, dialect.getName(), | ||||
dependentDialectRegistrations); | dependentDialectRegistrations); | ||||
// Check for any attributes/types registered to this dialect. If there are, | // Check for any attributes/types registered to this dialect. If there are, | ||||
// add the hooks for parsing/printing. | // add the hooks for parsing/printing. | ||||
if (!dialectAttrs.empty() || dialect.useDefaultAttributePrinterParser()) | if (!dialectAttrs.empty() || dialect.useDefaultAttributePrinterParser()) | ||||
os << attrParserDecl; | os << attrParserDecl; | ||||
if (!dialectTypes.empty()) | if (!dialectTypes.empty() || dialect.useDefaultTypePrinterParser()) | ||||
os << typeParserDecl; | os << typeParserDecl; | ||||
// Add the decls for the various features of the dialect. | // Add the decls for the various features of the dialect. | ||||
if (dialect.hasCanonicalizer()) | if (dialect.hasCanonicalizer()) | ||||
os << canonicalizerDecl; | os << canonicalizerDecl; | ||||
if (dialect.hasConstantMaterializer()) | if (dialect.hasConstantMaterializer()) | ||||
os << constantMaterializerDecl; | os << constantMaterializerDecl; | ||||
if (dialect.hasOperationAttrVerify()) | if (dialect.hasOperationAttrVerify()) | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |