PR2731: C and Ocaml bindings for setTailCall and isTailCall.
[oota-llvm.git] / lib / VMCore / Core.cpp
index bc7137b9d00a7392cff09a8ff1379d4abbe091c6..2fedc1e3f1d357f3418a85c1340db8dff89a7809 100644 (file)
@@ -719,17 +719,17 @@ void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC) {
   return unwrap<Function>(Fn)->setCallingConv(CC);
 }
 
-const char *LLVMGetCollector(LLVMValueRef Fn) {
+const char *LLVMGetGC(LLVMValueRef Fn) {
   Function *F = unwrap<Function>(Fn);
-  return F->hasCollector()? F->getCollector() : 0;
+  return F->hasGC()? F->getGC() : 0;
 }
 
-void LLVMSetCollector(LLVMValueRef Fn, const char *Coll) {
+void LLVMSetGC(LLVMValueRef Fn, const char *GC) {
   Function *F = unwrap<Function>(Fn);
-  if (Coll)
-    F->setCollector(Coll);
+  if (GC)
+    F->setGC(GC);
   else
-    F->clearCollector();
+    F->clearGC();
 }
 
 /*--.. Operations on parameters ............................................--*/
@@ -963,6 +963,16 @@ void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
         ParamAttr::constructAlignmentFromInt(align)));
 }
 
+/*--.. Operations on call instructions (only) ..............................--*/
+
+int LLVMIsTailCall(LLVMValueRef Call) {
+  return unwrap<CallInst>(Call)->isTailCall();
+}
+
+void LLVMSetTailCall(LLVMValueRef Call, int isTailCall) {
+  unwrap<CallInst>(Call)->setTailCall(isTailCall);
+}
+
 /*--.. Operations on phi nodes .............................................--*/
 
 void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,