mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 08:46:23 +00:00
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
This commit is contained in:
parent
4cc5eb2615
commit
591bda986e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user