aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-01 02:40:36 +0000
committerChris Lattner <sabre@nondot.org>2001-11-01 02:40:36 +0000
commit591bda986e750146133f31bedcff9952a822f0a7 (patch)
treefb31941fc79e8498e27be6f3108acc56152865ea
parent4cc5eb2615a8633a505dab199193133ee634da1f (diff)
Propogate name to the malloc itself instead of to the cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1071 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp
index 42dbebd61b..19e32c07c5 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -151,7 +151,9 @@ bool CleanupGCCOutput::doOneCleanupPass(Method *M) {
if (CallInst *CI = dyn_cast<CallInst>(I)) {
if (CI->getCalledValue() == Malloc) { // Replace call to malloc?
- MallocInst *MallocI = new MallocInst(PtrArrSByte, CI->getOperand(1));
+ MallocInst *MallocI = new MallocInst(PtrArrSByte, CI->getOperand(1),
+ CI->getName());
+ CI->setName("");
BI = BIL.insert(BI, MallocI)+1;
ReplaceInstWithInst(BIL, BI, new CastInst(MallocI, PtrSByte));
Changed = true;