[MLIR] Replace dialect registration hooks with dialect handle
authorGeorge <GeorgeLyon@users.noreply.github.com>
Tue, 9 Feb 2021 17:00:22 +0000 (09:00 -0800)
committerGeorge <GeorgeLyon@users.noreply.github.com>
Tue, 9 Feb 2021 17:02:16 +0000 (09:02 -0800)
commit5099a48a3bdc6a25b83c47281251825101727e96
tree70ef8409448488edb4908a8a874bc3b0bd6eb694
parent7dc31360339268b25d49680d23268731b33f51aa
[MLIR] Replace dialect registration hooks with dialect handle

Replace MlirDialectRegistrationHooks with MlirDialectHandle, which under-the-hood is an opaque pointer to MlirDialectRegistrationHooks. Then we expose the functionality previously directly on MlirDialectRegistrationHooks, as functions which take the opaque MlirDialectHandle struct. This makes the actual structure of the registration hooks an implementation detail, and happens to avoid this issue: https://llvm.discourse.group/t/strange-swift-issues-with-dialect-registration-hooks/2759/3

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D96229
mlir/include/mlir-c/Registration.h
mlir/include/mlir/CAPI/Registration.h
mlir/lib/CAPI/IR/CMakeLists.txt
mlir/lib/CAPI/IR/DialectHandle.cpp [new file with mode: 0644]
mlir/test/CAPI/ir.c