summaryrefslogtreecommitdiffstats
path: root/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-10-25 18:49:56 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-10-25 18:49:56 +0000
commitd1531a23494e5d9ead23f6640cd39e4ee7f90b39 (patch)
tree9997aabab3fa5326dfbf381767c0d7fdcd0281bb /llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
parentfe72fcebf697e18af1f8cfbc7a23761045897d9b (diff)
downloadbcm5719-llvm-d1531a23494e5d9ead23f6640cd39e4ee7f90b39.tar.gz
bcm5719-llvm-d1531a23494e5d9ead23f6640cd39e4ee7f90b39.zip
[OCaml] Expose Llvm_executionengine.ExecutionEngine.create_mcjit.
llvm-svn: 220619
Diffstat (limited to 'llvm/bindings/ocaml/executionengine/executionengine_ocaml.c')
-rw-r--r--llvm/bindings/ocaml/executionengine/executionengine_ocaml.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c b/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
index 4896c74121b..49e64f39266 100644
--- a/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
+++ b/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c
@@ -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);
OpenPOWER on IntegriCloud