aboutsummaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2009-09-14 21:54:32 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2009-09-14 21:54:32 +0000
commit713985a2dff2024cc0544f497714e239a01a6251 (patch)
treecbb64e4a82e058158e6100b8564160df011fe582 /bindings
parentf161b718f66f519f5fd348ec4619a1d928f25809 (diff)
downloadexternal_llvm-713985a2dff2024cc0544f497714e239a01a6251.zip
external_llvm-713985a2dff2024cc0544f497714e239a01a6251.tar.gz
external_llvm-713985a2dff2024cc0544f497714e239a01a6251.tar.bz2
Expose initializing the native target for the execution engine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/ocaml/executionengine/executionengine_ocaml.c8
-rw-r--r--bindings/ocaml/executionengine/llvm_executionengine.ml3
-rw-r--r--bindings/ocaml/executionengine/llvm_executionengine.mli3
3 files changed, 12 insertions, 2 deletions
diff --git a/bindings/ocaml/executionengine/executionengine_ocaml.c b/bindings/ocaml/executionengine/executionengine_ocaml.c
index 647759f..072d583 100644
--- a/bindings/ocaml/executionengine/executionengine_ocaml.c
+++ b/bindings/ocaml/executionengine/executionengine_ocaml.c
@@ -24,11 +24,15 @@
#include <string.h>
#include <assert.h>
-/* Force the LLVM interpreter, JIT, and native target to be linked in. */
+/* Force the LLVM interpreter and JIT to be linked in. */
void llvm_initialize(void) {
LLVMLinkInInterpreter();
LLVMLinkInJIT();
- LLVMInitializeNativeTarget();
+}
+
+/* unit -> bool */
+CAMLprim value llvm_initialize_native_target(value Unit) {
+ return Val_bool(LLVMInitializeNativeTarget());
}
/* Can't use the recommended caml_named_value mechanism for backwards
diff --git a/bindings/ocaml/executionengine/llvm_executionengine.ml b/bindings/ocaml/executionengine/llvm_executionengine.ml
index cf9acc7..c9e8f18 100644
--- a/bindings/ocaml/executionengine/llvm_executionengine.ml
+++ b/bindings/ocaml/executionengine/llvm_executionengine.ml
@@ -109,3 +109,6 @@ module ExecutionEngine = struct
*)
end
+
+external initialize_native_target : unit -> bool
+ = "llvm_initialize_native_target"
diff --git a/bindings/ocaml/executionengine/llvm_executionengine.mli b/bindings/ocaml/executionengine/llvm_executionengine.mli
index 32e2fdf..6c2fdfb 100644
--- a/bindings/ocaml/executionengine/llvm_executionengine.mli
+++ b/bindings/ocaml/executionengine/llvm_executionengine.mli
@@ -161,3 +161,6 @@ module ExecutionEngine: sig
[ee]. *)
val target_data: t -> Llvm_target.TargetData.t
end
+
+external initialize_native_target : unit -> bool
+ = "llvm_initialize_native_target"