File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11
11
#include " llvm-c/Support.h"
12
12
13
13
#include " llvm/IR/LLVMContext.h"
14
+ #include " llvm/IR/Module.h"
14
15
#include < memory>
15
16
16
17
#include " mlir/CAPI/IR.h"
@@ -25,14 +26,13 @@ LLVMModuleRef mlirTranslateModuleToLLVMIR(MlirOperation module,
25
26
MlirStringRef llvmModuleName) {
26
27
Operation *moduleOp = unwrap (module );
27
28
28
- llvm::LLVMContext *ctx = reinterpret_cast < llvm::LLVMContext *> (context);
29
+ llvm::LLVMContext *ctx = llvm::unwrap (context);
29
30
30
31
std::unique_ptr<llvm::Module> llvmModule = mlir::translateModuleToLLVMIR (
31
32
moduleOp, *ctx,
32
33
llvm::StringRef (llvmModuleName.data , llvmModuleName.length ));
33
34
34
- LLVMModuleRef moduleRef = reinterpret_cast <LLVMModuleRef>(
35
- const_cast <llvm::Module *>(llvmModule.release ()));
35
+ LLVMModuleRef moduleRef = llvm::wrap (llvmModule.release ());
36
36
37
37
return moduleRef;
38
38
}
You can’t perform that action at this time.
0 commit comments