Trying r45451 again, but this time warning-free on 3.10.x.
[oota-llvm.git] / bindings / ocaml / llvm / llvm_ocaml.c
index d095550962297737f29e6fa720bd8d92f4f4d028..3f48887e11f45d4bedccb007e4364f425f9a7a6f 100644 (file)
@@ -2,8 +2,8 @@
 |*                                                                            *|
 |*                     The LLVM Compiler Infrastructure                       *|
 |*                                                                            *|
-|* This file was developed by Gordon Henriksen and is distributed under the   *|
-|* University of Illinois Open Source License. See LICENSE.TXT for details.   *|
+|* This file is distributed under the University of Illinois Open Source      *|
+|* License. See LICENSE.TXT for details.                                      *|
 |*                                                                            *|
 |*===----------------------------------------------------------------------===*|
 |*                                                                            *|
@@ -45,7 +45,9 @@ static void llvm_raise(value Prototype, char *Message) {
   
   raise_with_arg(Prototype, CamlMessage);
   abort(); /* NOTREACHED */
-  CAMLnoreturn;
+#ifdef CAMLnoreturn
+  CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
+#endif
 }
 
 
@@ -652,6 +654,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 */