aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerAllocations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 71b45fdfea..1502fab759 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -150,6 +150,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
// Create the call to Malloc...
CallInst *MCall = new CallInst(MallocFunc, MallocArgs, "", I);
+ MCall->setTailCall();
// Create a cast instruction to convert to the right type...
Value *MCast;
@@ -180,7 +181,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
FreeArgs.push_back(Constant::getNullValue(FreeFTy->getParamType(i)));
// Insert a call to the free function...
- new CallInst(FreeFunc, FreeArgs, "", I);
+ (new CallInst(FreeFunc, FreeArgs, "", I))->setTailCall();
// Delete the old free instruction
I = --BBIL.erase(I);