diff options
| author | Peter Zotov <whitequark@whitequark.org> | 2014-08-12 02:55:45 +0000 |
|---|---|---|
| committer | Peter Zotov <whitequark@whitequark.org> | 2014-08-12 02:55:45 +0000 |
| commit | 6617777fa7db67a71e71a1382bba5cbc3c51201c (patch) | |
| tree | 4cd8be4fa92870bbc5526f2435fac3b1b4ecdf91 /llvm | |
| parent | b19f78f01d4d3ea2355373bcc7aa54dcbac84d76 (diff) | |
| download | bcm5719-llvm-6617777fa7db67a71e71a1382bba5cbc3c51201c.tar.gz bcm5719-llvm-6617777fa7db67a71e71a1382bba5cbc3c51201c.zip | |
[OCaml] Expose Llvm.get_operand_use.
Patch by Gabriel Radanne <drupyog@zoho.com>
llvm-svn: 215420
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/bindings/ocaml/llvm/llvm.ml | 1 | ||||
| -rw-r--r-- | llvm/bindings/ocaml/llvm/llvm.mli | 5 | ||||
| -rw-r--r-- | llvm/bindings/ocaml/llvm/llvm_ocaml.c | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/llvm/bindings/ocaml/llvm/llvm.ml b/llvm/bindings/ocaml/llvm/llvm.ml index a52bf004e59..470511af61b 100644 --- a/llvm/bindings/ocaml/llvm/llvm.ml +++ b/llvm/bindings/ocaml/llvm/llvm.ml @@ -428,6 +428,7 @@ let fold_right_uses f v init = (*--... Operations on users ................................................--*) external operand : llvalue -> int -> llvalue = "llvm_operand" +external operand_use : llvalue -> int -> lluse = "llvm_operand_use" external set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand" external num_operands : llvalue -> int = "llvm_num_operands" diff --git a/llvm/bindings/ocaml/llvm/llvm.mli b/llvm/bindings/ocaml/llvm/llvm.mli index adb87ef1170..9f34defda3d 100644 --- a/llvm/bindings/ocaml/llvm/llvm.mli +++ b/llvm/bindings/ocaml/llvm/llvm.mli @@ -720,6 +720,11 @@ val fold_right_uses : (lluse -> 'a -> 'a) -> llvalue -> 'a -> 'a method [llvm::User::getOperand]. *) val operand : llvalue -> int -> llvalue +(** [operand_use v i] returns the use of the operand at index [i] for the value [v]. See the + method [llvm::User::getOperandUse]. *) +val operand_use : llvalue -> int -> lluse + + (** [set_operand v i o] sets the operand of the value [v] at the index [i] to the value [o]. See the method [llvm::User::setOperand]. *) diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c index 3ec76835696..f0143a01a9b 100644 --- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c +++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c @@ -577,6 +577,11 @@ CAMLprim LLVMValueRef llvm_operand(LLVMValueRef V, value I) { return LLVMGetOperand(V, Int_val(I)); } +/* llvalue -> int -> lluse */ +CAMLprim LLVMUseRef llvm_operand_use(LLVMValueRef V, value I) { + return LLVMGetOperandUse(V, Int_val(I)); +} + /* llvalue -> int -> llvalue -> unit */ CAMLprim value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) { LLVMSetOperand(U, Int_val(I), V); |

