[llvm-commits] [llvm] r81800 - in /llvm/trunk: bindings/ocaml/executionengine/executionengine_ocaml.c bindings/ocaml/executionengine/llvm_executionengine.ml bindings/ocaml/executionengine/llvm_executionengine.mli docs/tutorial/OCamlLangImpl4.html docs/tutorial/OCamlLangImpl5.html docs/tutorial/OCamlLangImpl6.html docs/tutorial/OCamlLangImpl7.html

Erick Tryzelaar idadesub at users.sourceforge.net
Mon Sep 14 14:54:32 PDT 2009


Author: erickt
Date: Mon Sep 14 16:54:32 2009
New Revision: 81800

URL: http://llvm.org/viewvc/llvm-project?rev=81800&view=rev
Log:
Expose initializing the native target for the execution engine.

Modified:
    llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c
    llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml
    llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli
    llvm/trunk/docs/tutorial/OCamlLangImpl4.html
    llvm/trunk/docs/tutorial/OCamlLangImpl5.html
    llvm/trunk/docs/tutorial/OCamlLangImpl6.html
    llvm/trunk/docs/tutorial/OCamlLangImpl7.html

Modified: llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c Mon Sep 14 16:54:32 2009
@@ -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

Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml (original)
+++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml Mon Sep 14 16:54:32 2009
@@ -109,3 +109,6 @@
   
    *)
 end
+
+external initialize_native_target : unit -> bool
+                                  = "llvm_initialize_native_target"

Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli (original)
+++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli Mon Sep 14 16:54:32 2009
@@ -161,3 +161,6 @@
       [ee]. *)
   val target_data: t -> Llvm_target.TargetData.t
 end
+
+external initialize_native_target : unit -> bool
+                                  = "llvm_initialize_native_target"

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl4.html?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl4.html Mon Sep 14 16:54:32 2009
@@ -962,6 +962,8 @@
 open Llvm_scalar_opts
 
 let main () =
+  ignore (initialize_native_target ());
+
   (* Install standard binary operators.
    * 1 is the lowest precedence. *)
   Hashtbl.add Parser.binop_precedence '<' 10;

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl5.html?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl5.html Mon Sep 14 16:54:32 2009
@@ -1487,6 +1487,8 @@
 open Llvm_scalar_opts
 
 let main () =
+  ignore (initialize_native_target ());
+
   (* Install standard binary operators.
    * 1 is the lowest precedence. *)
   Hashtbl.add Parser.binop_precedence '<' 10;

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl6.html?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl6.html Mon Sep 14 16:54:32 2009
@@ -1486,6 +1486,8 @@
 open Llvm_scalar_opts
 
 let main () =
+  ignore (initialize_native_target ());
+
   (* Install standard binary operators.
    * 1 is the lowest precedence. *)
   Hashtbl.add Parser.binop_precedence '<' 10;

Modified: llvm/trunk/docs/tutorial/OCamlLangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl7.html?rev=81800&r1=81799&r2=81800&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/OCamlLangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/OCamlLangImpl7.html Mon Sep 14 16:54:32 2009
@@ -1816,6 +1816,8 @@
 open Llvm_scalar_opts
 
 let main () =
+  ignore (initialize_native_target ());
+
   (* Install standard binary operators.
    * 1 is the lowest precedence. *)
   Hashtbl.add Parser.binop_precedence '=' 2;





More information about the llvm-commits mailing list