mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
When we strength reduce an objc_retainBlock call to objc_retain, increment NumPeeps and make sure that Changed is set to true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8c87177f2c
commit
fca9d95523
@ -1383,12 +1383,17 @@ ObjCARCOpt::OptimizeRetainBlockCall(Function &F, Instruction *Inst,
|
||||
if (!IsRetainBlockOptimizable(Inst))
|
||||
return false;
|
||||
|
||||
Changed = true;
|
||||
++NumPeeps;
|
||||
|
||||
DEBUG(dbgs() << "Strength reduced retainBlock => retain.\n");
|
||||
DEBUG(dbgs() << "Old: " << *Inst << "\n");
|
||||
CallInst *RetainBlock = cast<CallInst>(Inst);
|
||||
RetainBlock->setCalledFunction(getRetainCallee(F.getParent()));
|
||||
// Remove copy_on_escape metadata.
|
||||
RetainBlock->setMetadata(CopyOnEscapeMDKind, 0);
|
||||
Class = IC_Retain;
|
||||
|
||||
DEBUG(dbgs() << "New: " << *Inst << "\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user