mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-06 20:18:14 +00:00
[OCaml] Expose Llvm_executionengine.ExecutionEngine.create_mcjit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220619 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -200,6 +200,24 @@ llvm_ee_create_jit(LLVMModuleRef M, value OptLevel) {
|
||||
return JIT;
|
||||
}
|
||||
|
||||
/* llmodule -> llcompileroption -> ExecutionEngine.t */
|
||||
CAMLprim LLVMExecutionEngineRef
|
||||
llvm_ee_create_mcjit(LLVMModuleRef M, value OptRecord) {
|
||||
LLVMExecutionEngineRef MCJIT;
|
||||
char *Error;
|
||||
struct LLVMMCJITCompilerOptions Options = {
|
||||
.OptLevel = Int_val(Field(OptRecord, 0)),
|
||||
.CodeModel = Int_val(Field(OptRecord, 1)),
|
||||
.NoFramePointerElim = Int_val(Field(OptRecord, 2)),
|
||||
.EnableFastISel = Int_val(Field(OptRecord, 3)),
|
||||
.MCJMM = NULL
|
||||
};
|
||||
if (LLVMCreateMCJITCompilerForModule(&MCJIT, M, &Options,
|
||||
sizeof(Options), &Error))
|
||||
llvm_raise(llvm_ee_error_exn, Error);
|
||||
return MCJIT;
|
||||
}
|
||||
|
||||
/* ExecutionEngine.t -> unit */
|
||||
CAMLprim value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
|
||||
LLVMDisposeExecutionEngine(EE);
|
||||
|
||||
Reference in New Issue
Block a user