unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
}
-int LLVMHasInitializer(LLVMValueRef GlobalVar) {
- return unwrap<GlobalVariable>(GlobalVar)->hasInitializer();
-}
-
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar) {
return wrap(unwrap<GlobalVariable>(GlobalVar)->getInitializer());
}
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 ............................................--*/
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,
/*===-- Instruction builders ----------------------------------------------===*/
LLVMBuilderRef LLVMCreateBuilder(void) {
- return wrap(new IRBuilder());
+ return wrap(new IRBuilder<>());
}
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,