aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp
index d91d23fd18..4d5650f90a 100644
--- a/lib/Transforms/IPO/RaiseAllocations.cpp
+++ b/lib/Transforms/IPO/RaiseAllocations.cpp
@@ -201,7 +201,9 @@ bool RaiseAllocations::runOnModule(Module &M) {
new BranchInst(II->getNormalDest(), I);
// Delete the old call site
- I->getParent()->getInstList().erase(I);
+ if (I->getType() != Type::VoidTy)
+ I->replaceAllUsesWith(UndefValue::get(I->getType()));
+ I->eraseFromParent();
Changed = true;
++NumRaised;
}