aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/ocaml/linker
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/ocaml/linker')
-rw-r--r--bindings/ocaml/linker/CMakeLists.txt5
-rw-r--r--bindings/ocaml/linker/linker_ocaml.c6
-rw-r--r--bindings/ocaml/linker/llvm_linker.ml8
-rw-r--r--bindings/ocaml/linker/llvm_linker.mli9
4 files changed, 10 insertions, 18 deletions
diff --git a/bindings/ocaml/linker/CMakeLists.txt b/bindings/ocaml/linker/CMakeLists.txt
new file mode 100644
index 0000000..b6bc8ac
--- /dev/null
+++ b/bindings/ocaml/linker/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_ocaml_library(llvm_linker
+ OCAML llvm_linker
+ OCAMLDEP llvm
+ C linker_ocaml
+ LLVM linker)
diff --git a/bindings/ocaml/linker/linker_ocaml.c b/bindings/ocaml/linker/linker_ocaml.c
index ed37777..3b8512a 100644
--- a/bindings/ocaml/linker/linker_ocaml.c
+++ b/bindings/ocaml/linker/linker_ocaml.c
@@ -23,11 +23,11 @@
void llvm_raise(value Prototype, char *Message);
-/* llmodule -> llmodule -> Mode.t -> unit */
-CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src, value Mode) {
+/* llmodule -> llmodule -> unit */
+CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src) {
char* Message;
- if (LLVMLinkModules(Dst, Src, Int_val(Mode), &Message))
+ if (LLVMLinkModules(Dst, Src, 0, &Message))
llvm_raise(*caml_named_value("Llvm_linker.Error"), Message);
return Val_unit;
diff --git a/bindings/ocaml/linker/llvm_linker.ml b/bindings/ocaml/linker/llvm_linker.ml
index 5854d70..3044abd 100644
--- a/bindings/ocaml/linker/llvm_linker.ml
+++ b/bindings/ocaml/linker/llvm_linker.ml
@@ -11,11 +11,5 @@ exception Error of string
let () = Callback.register_exception "Llvm_linker.Error" (Error "")
-module Mode = struct
- type t =
- | DestroySource
- | PreserveSource
-end
-
-external link_modules : Llvm.llmodule -> Llvm.llmodule -> Mode.t -> unit
+external link_modules : Llvm.llmodule -> Llvm.llmodule -> unit
= "llvm_link_modules"
diff --git a/bindings/ocaml/linker/llvm_linker.mli b/bindings/ocaml/linker/llvm_linker.mli
index 4def7a8..06c3b92 100644
--- a/bindings/ocaml/linker/llvm_linker.mli
+++ b/bindings/ocaml/linker/llvm_linker.mli
@@ -14,13 +14,6 @@
exception Error of string
-(** Linking mode. *)
-module Mode : sig
- type t =
- | DestroySource
- | PreserveSource
-end
-
(** [link_modules dst src mode] links [src] into [dst], raising [Error]
if the linking fails. *)
-val link_modules : Llvm.llmodule -> Llvm.llmodule -> Mode.t -> unit \ No newline at end of file
+val link_modules : Llvm.llmodule -> Llvm.llmodule -> unit \ No newline at end of file