1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[OCaml] Expose Llvm.get_operand_use.

Patch by Gabriel Radanne <drupyog@zoho.com>

llvm-svn: 215420
This commit is contained in:
Peter Zotov 2014-08-12 02:55:45 +00:00
parent 58cb4e0217
commit 637a91873c
3 changed files with 11 additions and 0 deletions

View File

@ -428,6 +428,7 @@ let fold_right_uses f v init =
(*--... Operations on users ................................................--*) (*--... Operations on users ................................................--*)
external operand : llvalue -> int -> llvalue = "llvm_operand" 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 set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand"
external num_operands : llvalue -> int = "llvm_num_operands" external num_operands : llvalue -> int = "llvm_num_operands"

View File

@ -720,6 +720,11 @@ val fold_right_uses : (lluse -> 'a -> 'a) -> llvalue -> 'a -> 'a
method [llvm::User::getOperand]. *) method [llvm::User::getOperand]. *)
val operand : llvalue -> int -> llvalue 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 (** [set_operand v i o] sets the operand of the value [v] at the index [i] to
the value [o]. the value [o].
See the method [llvm::User::setOperand]. *) See the method [llvm::User::setOperand]. *)

View File

@ -577,6 +577,11 @@ CAMLprim LLVMValueRef llvm_operand(LLVMValueRef V, value I) {
return LLVMGetOperand(V, Int_val(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 */ /* llvalue -> int -> llvalue -> unit */
CAMLprim value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) { CAMLprim value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) {
LLVMSetOperand(U, Int_val(I), V); LLVMSetOperand(U, Int_val(I), V);