[llvm] r215420 - [OCaml] Expose Llvm.get_operand_use.
Peter Zotov
whitequark at whitequark.org
Mon Aug 11 19:55:46 PDT 2014
Author: whitequark
Date: Mon Aug 11 21:55:45 2014
New Revision: 215420
URL: http://llvm.org/viewvc/llvm-project?rev=215420&view=rev
Log:
[OCaml] Expose Llvm.get_operand_use.
Patch by Gabriel Radanne <drupyog at zoho.com>
Modified:
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=215420&r1=215419&r2=215420&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Mon Aug 11 21:55:45 2014
@@ -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"
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=215420&r1=215419&r2=215420&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Mon Aug 11 21:55:45 2014
@@ -720,6 +720,11 @@ val fold_right_uses : (lluse -> '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]. *)
Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=215420&r1=215419&r2=215420&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Mon Aug 11 21:55:45 2014
@@ -577,6 +577,11 @@ CAMLprim LLVMValueRef llvm_operand(LLVMV
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);
More information about the llvm-commits
mailing list