<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 29, 2011, at 11:49 PM, Jordy Rose wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ah. I was thinking something like this:<br><br>1. GC Disabled<br>a) create CheckerManager and register checkers<br>b) run non-path-sensitive analyses<br>c) run path-sensitive analyses<br>2. GC Enabled<br>a) create CheckerManager and register checkers<br>b) run non-path-sensitive analyses<br>c) run path-sensitive analyses<br><br></span></blockquote><div><br></div><div>Let's call this plan A.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">It sounds like you're thinking:<br><br>1. Create CheckerManager and register checkers<br>2. Mgr->setGCEnabled(true)<br>a) run non-path-sensitive analyses<br>b) run path-sensitive analyses<br>3. GC Enabled<br>a) run non-path-sensitive analyses<br>b) run path-sensitive analyses<br></span></blockquote><div><br></div>Let's call this plan B.</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br>...and then checkers check if GC is enabled every time it's interesting, instead of once at registration time.<br></span></blockquote><div><br></div><div>That's clearer.  I think your plan sounds cleaner (plan A).  Couple concerns:</div><div><br></div><div>(1) I still want checkers to be written so that if they want GC-specific logic, they don't need to be written as a separate checker.  For the Retain/Release checker, we can still keep conditional behavior just by passing the "GC enabled" flag to the checker at construction time.</div><div><br></div><div>(2) While I'm fine with checkers being run multiple times, we're still going to want to merge duplicate diagnostics.</div><div><br></div><div>For (2), I'm thinking we need a step 0.  e.g.:</div><div><br></div><div>0. Create a single PathDiagnosticClient that batches all results and uniques them.  Use this PathDiagnosticClient for everything.  We can put this logic into the PathDiagnosticClient base class.</div><div>1. GC Disabled<br>a) create CheckerManager and register checkers<br>b) run non-path-sensitive analyses<br>c) run path-sensitive analyses<br>2. GC Enabled<br>a) create CheckerManager and register checkers<br>b) run non-path-sensitive analyses<br>c) run path-sensitive analyses</div><div><br></div><div>Currently BugReporter does some uniquing of reports, and that's fine to keep (it serves a different purpose), but I think we'll want an easy way to unique all the diagnostics from all checkers.  That also can be used as a mechanism to solve the problem of printing all diagnostics in SourceLocation order to the terminal.</div><div><br></div><div>Of course, we can add step 0 later, but we need to account for it in the design.</div><div><br></div><div>What do you think?</div></div></body></html>