diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/ExprTypeConvert.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/IPO/ArgumentPromotion.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/IPO/DeadArgumentElimination.cpp | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index f43390da83..a022461d33 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -523,6 +523,8 @@ Value *llvm::ConvertExpressionToType(Value *V, const Type *Ty, Res = new CallInst(Constant::getNullValue(NewPTy), std::vector<Value*>(I->op_begin()+1, I->op_end()), Name); + if (cast<CallInst>(I)->isTailCall()) + cast<CallInst>(Res)->setTailCall(); VMC.ExprMap[I] = Res; Res->setOperand(0, ConvertExpressionToType(I->getOperand(0),NewPTy,VMC,TD)); break; diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index 028fda9aeb..fd5a5d0215 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -443,6 +443,8 @@ Function *ArgPromotion::DoPromotion(Function *F, Args, "", Call); } else { New = new CallInst(NF, Args, "", Call); + if (cast<CallInst>(Call)->isTailCall()) + cast<CallInst>(New)->setTailCall(); } Args.clear(); diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 3a2a5f08a8..2dbc5c3169 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -430,6 +430,8 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) { Args, "", Call); } else { New = new CallInst(NF, Args, "", Call); + if (cast<CallInst>(Call)->isTailCall()) + cast<CallInst>(New)->setTailCall(); } Args.clear(); |