PR2731: C and Ocaml bindings for setTailCall and isTailCall.
[oota-llvm.git] / bindings / ocaml / llvm / llvm.mli
index 1f4c4a5d6ed33e335c4ab9f6214a8ed498fc232f..d9fb11e5fe105aff668f349ee2027ea14be3a3e7 100644 (file)
@@ -921,14 +921,14 @@ external function_call_conv : llvalue -> int = "llvm_function_call_conv"
 external set_function_call_conv : int -> llvalue -> unit
                                 = "llvm_set_function_call_conv"
 
-(** [collector f] returns [Some name] if the function [f] has a garbage
+(** [gc f] returns [Some name] if the function [f] has a garbage
     collection algorithm specified and [None] otherwise.
-    See the method [llvm::Function::getCollector]. *)
-external collector : llvalue -> string option = "llvm_collector"
+    See the method [llvm::Function::getGC]. *)
+external gc : llvalue -> string option = "llvm_gc"
 
-(** [set_collector gc f] sets the collection algorithm for the function [f] to
-    [gc]. See the method [llvm::Function::setCollector]. *)
-external set_collector : string option -> llvalue -> unit = "llvm_set_collector"
+(** [set_gc gc f] sets the collection algorithm for the function [f] to
+    [gc]. See the method [llvm::Function::setGC]. *)
+external set_gc : string option -> llvalue -> unit = "llvm_set_gc"
 
 
 (** {7 Operations on params} *)
@@ -1126,6 +1126,17 @@ external instruction_call_conv: llvalue -> int
 external set_instruction_call_conv: int -> llvalue -> unit
                                   = "llvm_set_instruction_call_conv"
 
+(** {Operations on call instructions (only)} *)
+
+(** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as
+    eligible for tail call optimization, [false] otherwise.
+    See the method [llvm::CallInst::isTailCall]. *)
+external is_tail_call : llvalue -> bool = "llvm_is_tail_call"
+
+(** [set_tail_call tc ci] flags the call instruction [ci] as eligible for tail
+    call optimization if [tc] is [true], clears otherwise.
+    See the method [llvm::CallInst::setTailCall]. *)
+external set_tail_call : bool -> llvalue -> unit = "llvm_set_tail_call"
 
 (** {7 Operations on phi nodes} *)