[clang] [flang] [mlir] [mlir][ODS] Generate hooks that register the attributes and types of a dialect (PR #243481)

Alex Zinenko via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 00:25:47 PST 2026


================
@@ -204,3 +207,18 @@ def J_CustomStorageCtorAttr : AttrDef<Test_Dialect, "CustomStorageCtorAttr"> {
 // DEF-LABEL: struct CustomStorageCtorAttrAttrStorage : public ::mlir::AttributeStorage
 // DEF: static CustomStorageCtorAttrAttrStorage *construct
 // DEF-SAME: (::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey);
+
+// The registration hook registers every attribute.
+// DECL: class TestDialect;
+// DECL-NEXT: /// Registers the attributes defined in this file with `dialect`.
+// DECL-NEXT: void registerTestDialectAttributes(TestDialect *dialect);
+// DECL-EMPTY:
----------------
ftynse wrote:

Nit: is this necessary?

https://github.com/llvm/llvm-project/pull/243481


More information about the cfe-commits mailing list