<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 5, 2013, at 3:54 PM, Michael Gottesman <<a href="mailto:mgottesman@apple.com">mgottesman@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: mgottesman<br>Date: Fri Apr 5 17:54:28 2013<br>New Revision: 178921<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=178921&view=rev">http://llvm.org/viewvc/llvm-project?rev=178921&view=rev</a><br>Log:<br>Properly model precise lifetime when given an incomplete dataflow sequence.<br><br>Modified: llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp?rev=178921&r1=178920&r2=178921&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp?rev=178921&r1=178920&r2=178921&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp (original)<br>+++ llvm/trunk/lib/Transforms/ObjCARC/ObjCARCOpts.cpp Fri Apr 5 17:54:28 2013<br>@@ -408,6 +408,10 @@ namespace {<br> KnownSafe(false), IsTailCallRelease(false), ReleaseMetadata(0) {}<br><br> void clear();<br>+ <br></div></blockquote><div><br></div>Please remove the trailing whitespace here.</div><div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">+ bool IsTrackingImpreciseReleases() {<br>+ return ReleaseMetadata != 0;<br>+ }<br> };<br>}<br><br>@@ -1746,7 +1750,9 @@ ObjCARCOpt::VisitInstructionBottomUp(Ins<br> bool NestingDetected = false;<br> InstructionClass Class = GetInstructionClass(Inst);<br> const Value *Arg = 0;<br>-<br>+ <br>+ DEBUG(dbgs() << "Class: " << Class << "\n");<br>+ <br></div></blockquote><div><br></div>…and here, and also on most of the other blank lines added to this file in this patch.</div><div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"> switch (Class) {<br> case IC_Release: {<br> Arg = GetObjCArg(Inst);<br>@@ -1794,7 +1800,10 @@ ObjCARCOpt::VisitInstructionBottomUp(Ins<br> case S_Release:<br> case S_MovableRelease:<br> case S_Use:<br>- S.RRI.ReverseInsertPts.clear();<br>+ // If OldSeq is not S_Use or OldSeq is S_Use and we are tracking an<br>+ // imprecise release, clear our reverse insertion points.<br>+ if (OldSeq != S_Use || S.RRI.IsTrackingImpreciseReleases())<br>+ S.RRI.ReverseInsertPts.clear();<br> // FALL THROUGH<br> case S_CanRelease:<br> // Don't do retain+release tracking for IC_RetainRV, because it's<br>@@ -2017,14 +2026,19 @@ ObjCARCOpt::VisitInstructionTopDown(Inst<br><br> PtrState &S = MyStates.getPtrTopDownState(Arg);<br> S.ClearKnownPositiveRefCount();<br>-<br>- switch (S.GetSeq()) {<br>+ <br>+ Sequence OldSeq = S.GetSeq();<br>+ <br>+ MDNode *ReleaseMetadata = Inst->getMetadata(ImpreciseReleaseMDKind);<br>+ <br>+ switch (OldSeq) {<br> case S_Retain:<br> case S_CanRelease:<br>- S.RRI.ReverseInsertPts.clear();<br>+ if (OldSeq == S_Retain || ReleaseMetadata != 0)<br>+ S.RRI.ReverseInsertPts.clear();<br> // FALL THROUGH<br> case S_Use:<br>- S.RRI.ReleaseMetadata = Inst->getMetadata(ImpreciseReleaseMDKind);<br>+ S.RRI.ReleaseMetadata = ReleaseMetadata;<br> S.RRI.IsTailCallRelease = cast<CallInst>(Inst)->isTailCall();<br> Releases[Inst] = S.RRI;<br> ANNOTATE_TOPDOWN(Inst, Arg, S.GetSeq(), S_None)<br>;<br><br><br></div></blockquote></div><br></body></html>