[llvm] r368953 - Revert "Expose TailCallKind via the LLVM C API"
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 20:49:51 PDT 2019
Author: jdevlieghere
Date: Wed Aug 14 20:49:51 2019
New Revision: 368953
URL: http://llvm.org/viewvc/llvm-project?rev=368953&view=rev
Log:
Revert "Expose TailCallKind via the LLVM C API"
This is failing on several build bots. Reverting as discussed in
https://reviews.llvm.org/D66061.
Modified:
llvm/trunk/include/llvm-c/Core.h
llvm/trunk/lib/IR/Core.cpp
llvm/trunk/test/Bindings/llvm-c/invoke.ll
llvm/trunk/tools/llvm-c-test/echo.cpp
Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=368953&r1=368952&r2=368953&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Wed Aug 14 20:49:51 2019
@@ -452,13 +452,6 @@ enum {
typedef unsigned LLVMAttributeIndex;
-typedef enum {
- LLVMTailCallKindNone,
- LLVMTailCallKindTail,
- LLVMTailCallKindMustTail,
- LLVMTailCallKindNoTail
-} LLVMTailCallKind;
-
/**
* @}
*/
@@ -3271,24 +3264,6 @@ LLVMBool LLVMIsTailCall(LLVMValueRef Cal
void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
/**
- * Obtains the kind of tail call for a call instruction.
- *
- * This only works on llvm::CallInst instructions.
- *
- * @see llvm::CallInst::getTailCallKind()
- */
-LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst);
-
-/**
- * Set the kind of tail call for a call instruction.
- *
- * This only works on llvm::CallInst instructions.
- *
- * @see llvm::CallInst::setTailCallKind()
- */
-void LLVMSetTailCallKind(LLVMValueRef CallInst, LLVMTailCallKind TCK);
-
-/**
* Return the normal destination basic block.
*
* This only works on llvm::InvokeInst instructions.
Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=368953&r1=368952&r2=368953&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Wed Aug 14 20:49:51 2019
@@ -2844,39 +2844,6 @@ void LLVMSetTailCall(LLVMValueRef Call,
unwrap<CallInst>(Call)->setTailCall(isTailCall);
}
-LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef Call) {
- switch (unwrap<CallInst>(Call)->getTailCallKind()) {
- case CallInst::TailCallKind::TCK_None:
- return LLVMTailCallKindNone;
- case CallInst::TailCallKind::TCK_Tail:
- return LLVMTailCallKindTail;
- case CallInst::TailCallKind::TCK_MustTail:
- return LLVMTailCallKindMustTail;
- case CallInst::TailCallKind::TCK_NoTail:
- return LLVMTailCallKindNoTail;
- }
-}
-
-void LLVMSetTailCallKind(LLVMValueRef Call, LLVMTailCallKind TCK) {
- CallInst::TailCallKind kind;
- switch (TCK) {
- case LLVMTailCallKindNone:
- kind = CallInst::TailCallKind::TCK_None;
- break;
- case LLVMTailCallKindTail:
- kind = CallInst::TailCallKind::TCK_Tail;
- break;
- case LLVMTailCallKindMustTail:
- kind = CallInst::TailCallKind::TCK_MustTail;
- break;
- case LLVMTailCallKindNoTail:
- kind = CallInst::TailCallKind::TCK_NoTail;
- break;
- }
-
- unwrap<CallInst>(Call)->setTailCallKind(kind);
-}
-
/*--.. Operations on invoke instructions (only) ............................--*/
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef Invoke) {
Modified: llvm/trunk/test/Bindings/llvm-c/invoke.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/llvm-c/invoke.ll?rev=368953&r1=368952&r2=368953&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/llvm-c/invoke.ll (original)
+++ llvm/trunk/test/Bindings/llvm-c/invoke.ll Wed Aug 14 20:49:51 2019
@@ -55,12 +55,12 @@ catch:
ret i32 %merge
unwind3: ; preds = %landingPad
- %8 = musttail call i32 @llvm.eh.typeid.for(i8* nonnull bitcast (%C6object9ClassInfo* @C6object9Exception__ClassInfo to i8*))
+ %8 = tail call i32 @llvm.eh.typeid.for(i8* nonnull bitcast (%C6object9ClassInfo* @C6object9Exception__ClassInfo to i8*))
%9 = icmp eq i32 %8, %5
br i1 %9, label %catch, label %unwind5
unwind5: ; preds = %unwind3
- %10 = notail call i32 @llvm.eh.typeid.for(i8* nonnull bitcast (%C6object9ClassInfo* @C6object9Throwable__ClassInfo to i8*))
+ %10 = tail call i32 @llvm.eh.typeid.for(i8* nonnull bitcast (%C6object9ClassInfo* @C6object9Throwable__ClassInfo to i8*))
%11 = icmp eq i32 %10, %5
br i1 %11, label %catch, label %unwind7
Modified: llvm/trunk/tools/llvm-c-test/echo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-c-test/echo.cpp?rev=368953&r1=368952&r2=368953&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-c-test/echo.cpp (original)
+++ llvm/trunk/tools/llvm-c-test/echo.cpp Wed Aug 14 20:49:51 2019
@@ -643,7 +643,7 @@ struct FunCloner {
Args.push_back(CloneValue(LLVMGetOperand(Src, i)));
LLVMValueRef Fn = CloneValue(LLVMGetCalledValue(Src));
Dst = LLVMBuildCall(Builder, Fn, Args.data(), ArgCount, Name);
- LLVMSetTailCallKind(Dst, LLVMGetTailCallKind(Src));
+ LLVMSetTailCall(Dst, LLVMIsTailCall(Src));
CloneAttrs(Src, Dst);
break;
}
More information about the llvm-commits
mailing list