Skip to content

Commit

Permalink
[OCaml] Fix ABI incompatibility
Browse files Browse the repository at this point in the history
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
  • Loading branch information
whitequark committed Nov 3, 2013
1 parent 9d33bf7 commit 88d74c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/ocaml/llvm/llvm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions bindings/ocaml/llvm/llvm_ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 88d74c3

Please sign in to comment.