From 591bda986e750146133f31bedcff9952a822f0a7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 1 Nov 2001 02:40:36 +0000 Subject: [PATCH] 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 --- lib/Transforms/IPO/DeadTypeElimination.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp index 42dbebd61bd..19e32c07c58 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(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;