forked from OSchip/llvm-project
When we strength reduce an objc_retainBlock call to objc_retain, increment NumPeeps and make sure that Changed is set to true.
llvm-svn: 179968
This commit is contained in:
parent
1e43004295
commit
3eab2e43d2
|
@ -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…
Reference in New Issue