[PATCH] D76329: [MLIR] Deduplicate dialect registration by ClassID

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 17:25:50 PDT 2020


GMNGeoffrey marked 2 inline comments as done.
GMNGeoffrey added inline comments.


================
Comment at: mlir/lib/IR/Dialect.cpp:39
 /// used through the DialectRegistration template.
-void mlir::registerDialectAllocator(const DialectAllocatorFunction &function) {
+void mlir::registerDialectAllocator(const ClassID *classId,
+                                    const DialectAllocatorFunction &function) {
----------------
rriddle wrote:
> Can you make this a private method inside of `Dialect` that is only accessible via `registerDialect`?
Made this and the corresponding hooks setter registration private static methods on the class with friend declarations. Hopefully that's what you meant. In the process, made the registration for hooks and dialects the same format (separate the free template function and the global initialization struct).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76329/new/

https://reviews.llvm.org/D76329





More information about the llvm-commits mailing list