<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 25, 2012, at 3:59 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">/// Recursively scan through a path and prune out calls and macros pieces<br>/// that aren't needed. Return true if afterwards the path contains<br>/// "interesting stuff" which means it should be pruned from the parent path.<br>@@ -2016,10 +2078,16 @@<br> } while(finalReportConfigToken != originalReportConfigToken);<br><br> // Finally, prune the diagnostic path of uninteresting stuff.<br>- if (!PD.path.empty() && R->shouldPrunePath()) {<br>- bool hasSomethingInteresting = RemoveUneededCalls(PD.getMutablePieces(), R);<br>- assert(hasSomethingInteresting);<br>- (void) hasSomethingInteresting;<br>+ if (!PD.path.empty()) {<br>+ // Remove messages that are basically the same.<br>+ RemoveRedundantMsgs(PD.getMutablePieces());<br>+<br>+ if (R->shouldPrunePath()) {<br>+ bool hasSomethingInteresting = RemoveUneededCalls(PD.getMutablePieces(),<br>+ R);<br>+ assert(hasSomethingInteresting);<br>+ (void) hasSomethingInteresting;<br>+ }<br></blockquote><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">It's probably cheaper to do this in the other order.</span></blockquote></div><br><div>Hi Jordan,</div><div><br></div><div>That is true, but I think RemoveUneededCalls should always come last, after we have done all of other passes over the PathPieces. The idea is that the more we remove from the path, there is a higher chance that RemoveUneededCalls will be able to remove a call. That won't apply in this scenario because of how RemoveRedundantMsgs works, but it's something that would be easy to get wrong if we added more "passes" like this where the implications are slightly different.</div><div><br></div><div>Ted</div></body></html>