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:
Michael Gottesman 2013-04-21 00:50:27 +00:00
parent 1e43004295
commit 3eab2e43d2
1 changed files with 6 additions and 1 deletions

View File

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