[Mlir-commits] [mlir] [mlir][llvmir] expose TypeFromLLVMIRTranslator (PR #124864)

Markus Böck llvmlistbot at llvm.org
Wed Jan 29 14:45:19 PST 2025


================
@@ -32,6 +32,21 @@ extern "C" {
 MLIR_CAPI_EXPORTED LLVMModuleRef
 mlirTranslateModuleToLLVMIR(MlirOperation module, LLVMContextRef context);
 
+struct MlirTypeFromLLVMIRTranslator {
+  void *ptr;
+};
+
+typedef struct MlirTypeFromLLVMIRTranslator MlirTypeFromLLVMIRTranslator;
+
+MLIR_CAPI_EXPORTED MlirTypeFromLLVMIRTranslator
+mlirTypeFromLLVMIRTranslatorCreate(MlirContext ctx);
----------------
zero9178 wrote:

Since we have a create function here that uses `new`, we'll also need a corresponding `destroy` function (see e.g. https://github.com/llvm/llvm-project/blob/774b12c4a06bd68f314bd741be0eb77a1cb49b7d/mlir/include/mlir-c/Rewrite.h#L281), otherwise it is impossible to not cause a memory leak. Could you add such a function?



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


More information about the Mlir-commits mailing list