From 31b80d98ad2ee847edc636f15e0244dcac7e6643 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 22 Jan 2002 03:30:06 +0000 Subject: [PATCH 1/1] Don't insert a useless cast git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1527 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerAllocations.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 041d89fab17..0d26e2a2336 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -165,8 +165,7 @@ bool RaiseAllocations::runOnBasicBlock(BasicBlock *BB) { MallocInst *MallocI = new MallocInst(PtrSByte, CI->getOperand(1), CI->getName()); CI->setName(""); - BI = BIL.insert(BI, MallocI)+1; - ReplaceInstWithInst(BIL, BI, new CastInst(MallocI, PtrSByte)); + ReplaceInstWithInst(BIL, BI, MallocI); Changed = true; continue; // Skip the ++BI } else if (CI->getCalledValue() == FreeMeth) { // Replace call to free? -- 2.34.1