[OCaml] Fix ABI incompatibility
authorPeter Zotov <whitequark@whitequark.org>
Sun, 3 Nov 2013 08:27:37 +0000 (08:27 +0000)
committerPeter Zotov <whitequark@whitequark.org>
Sun, 3 Nov 2013 08:27:37 +0000 (08:27 +0000)
OCaml's type unit is not compatible with C's type void.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193952 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/ocaml/llvm/llvm.ml
bindings/ocaml/llvm/llvm_ocaml.c

index b169b85bc99f90b7a133f89d86f46a7b3bca481f..67427089fe2f42944c00e4b5cc9a3d7c12c59991 100644 (file)
@@ -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
 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"
 
 (*--... Operations on uses .................................................--*)
 external use_begin : llvalue -> lluse option = "llvm_use_begin"
index 6de935ab107d1deec61181fd941ccb9ee91fba13..80fa8c3670da9ea800efdab9c0115ae33593913a 100644 (file)
@@ -485,6 +485,13 @@ CAMLprim value llvm_dump_value(LLVMValueRef Val) {
   return Val_unit;
 }
 
   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 */
 /*--... Operations on users ................................................--*/
 
 /* llvalue -> int -> llvalue */