diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-04-21 00:50:27 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-04-21 00:50:27 +0000 |
commit | fca9d95523dd290209bf15e0ef9d9aa373058636 (patch) | |
tree | 043145fec93a0095d1089c257d4c48b923488a87 /lib/Transforms/ObjCARC/ObjCARCOpts.cpp | |
parent | 8c87177f2cd2fba8adbd5ccd1ebaad7b4112bace (diff) |
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
Diffstat (limited to 'lib/Transforms/ObjCARC/ObjCARCOpts.cpp')
-rw-r--r-- | lib/Transforms/ObjCARC/ObjCARCOpts.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/lib/Transforms/ObjCARC/ObjCARCOpts.cpp index 89e7510ec9..7a7cdbec10 100644 --- a/lib/Transforms/ObjCARC/ObjCARCOpts.cpp +++ b/lib/Transforms/ObjCARC/ObjCARCOpts.cpp @@ -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; } |