Propogate name to the malloc itself instead of to the cast

llvm-svn: 1071
This commit is contained in:
Chris Lattner 2001-11-01 02:40:36 +00:00
parent d307537327
commit 246f157af4
1 changed files with 3 additions and 1 deletions

View File

@ -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;