summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-29 20:45:00 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-29 20:45:00 +0000
commitcc0928ff22d9f3e8f2930874f6727db8c700ec35 (patch)
tree3c1111e6f78118c02964ced26c7aca9de33bcaf1 /bindings
parent21c62da287237d39d0d95004881ea4baae3be6da (diff)
downloadllvm-cc0928ff22d9f3e8f2930874f6727db8c700ec35.tar.gz
llvm-cc0928ff22d9f3e8f2930874f6727db8c700ec35.tar.bz2
llvm-cc0928ff22d9f3e8f2930874f6727db8c700ec35.tar.xz
Bindings for instruction calling conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/ocaml/llvm/llvm.ml6
-rw-r--r--bindings/ocaml/llvm/llvm.mli14
-rw-r--r--bindings/ocaml/llvm/llvm_ocaml.c13
3 files changed, 33 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml
index 457677b493..fa4db0e811 100644
--- a/bindings/ocaml/llvm/llvm.ml
+++ b/bindings/ocaml/llvm/llvm.ml
@@ -328,6 +328,12 @@ external value_of_block : llbasicblock -> llvalue = "LLVMBasicBlockAsValue"
external value_is_block : llvalue -> bool = "llvm_value_is_block"
external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock"
+(*--... Operations on call sites ...........................................--*)
+external instruction_call_conv: llvalue -> int
+ = "llvm_instruction_call_conv"
+external set_instruction_call_conv: int -> llvalue -> unit
+ = "llvm_set_instruction_call_conv"
+
(*--... Operations on phi nodes ............................................--*)
external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
= "llvm_add_incoming"
diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli
index 8f2c9219e3..6d980a1470 100644
--- a/bindings/ocaml/llvm/llvm.mli
+++ b/bindings/ocaml/llvm/llvm.mli
@@ -854,6 +854,20 @@ external value_is_block : llvalue -> bool = "llvm_value_is_block"
(** [block_of_value v] losslessly casts [v] to an [llbasicblock]. **)
external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock"
+(*--... Operations on call sites ...........................................--*)
+
+(** [inst_call_conv ci] is the calling convention for the call or invoke
+ instruction [ci], which may be one of the values from the module [CallConv].
+ See the method [CallSite:: **)
+external instruction_call_conv: llvalue -> int
+ = "llvm_instruction_call_conv"
+
+(** [set_inst_call_conv cc ci] sets the calling convention for the call or
+ invoke instruction [ci] to the integer [cc], which can be one of the values
+ from the module [CallConv]. See the method [CallSite::]. **)
+external set_instruction_call_conv: int -> llvalue -> unit
+ = "llvm_set_instruction_call_conv"
+
(*--... Operations on phi nodes ............................................--*)
(** [add_incoming (v, bb) pn] adds the value [v] to the phi node [pn] for use
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c
index d095550962..35c2c8da4b 100644
--- a/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/bindings/ocaml/llvm/llvm_ocaml.c
@@ -652,6 +652,19 @@ CAMLprim value llvm_value_is_block(LLVMValueRef Val) {
return Val_bool(LLVMValueIsBasicBlock(Val));
}
+/*--... Operations on call sites ...........................................--*/
+
+/* llvalue -> int */
+CAMLprim value llvm_instruction_call_conv(LLVMValueRef Inst) {
+ return Val_int(LLVMGetInstructionCallConv(Inst));
+}
+
+/* int -> llvalue -> unit */
+CAMLprim value llvm_set_instruction_call_conv(value CC, LLVMValueRef Inst) {
+ LLVMSetInstructionCallConv(Inst, Int_val(CC));
+ return Val_unit;
+}
+
/*--... Operations on phi nodes ............................................--*/
/* (llvalue * llbasicblock) -> llvalue -> unit */