From 57d8f2c2e97c4c6dea2f800606e951c6440cfb3a Mon Sep 17 00:00:00 2001 From: Peter Zotov Date: Sun, 3 Nov 2013 08:27:37 +0000 Subject: [PATCH] [OCaml] Fix ABI incompatibility OCaml's type unit is not compatible with C's type void. llvm-svn: 193952 --- bindings/ocaml/llvm/llvm.ml | 2 +- bindings/ocaml/llvm/llvm_ocaml.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml index b169b85bc99..67427089fe2 100644 --- a/bindings/ocaml/llvm/llvm.ml +++ b/bindings/ocaml/llvm/llvm.ml @@ -332,7 +332,7 @@ external value_name : llvalue -> string = "llvm_value_name" external set_value_name : string -> llvalue -> unit = "llvm_set_value_name" external dump_value : llvalue -> unit = "llvm_dump_value" external replace_all_uses_with : llvalue -> llvalue -> unit - = "LLVMReplaceAllUsesWith" + = "llvm_replace_all_uses_with" (*--... Operations on uses .................................................--*) external use_begin : llvalue -> lluse option = "llvm_use_begin" diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 6de935ab107..80fa8c3670d 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -485,6 +485,13 @@ CAMLprim value llvm_dump_value(LLVMValueRef Val) { return Val_unit; } +/* llvalue -> llvalue -> unit */ +CAMLprim value llvm_replace_all_uses_with(LLVMValueRef OldVal, + LLVMValueRef NewVal) { + LLVMReplaceAllUsesWith(OldVal, NewVal); + return Val_unit; +} + /*--... Operations on users ................................................--*/ /* llvalue -> int -> llvalue */