r182502 - [analyzer; alternate edges] remove puny edges on the same line that span less than 3 columns.

Ted Kremenek kremenek at apple.com
Wed May 22 12:23:52 PDT 2013


On May 22, 2013, at 11:59 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> Yeah, this is pretty much what I was thinking as well; the missing piece in my mind was that it has to run after regular optimization has hit its steady-state. But why is this pass working on statement-locations, instead of just flattening to a FullSourceLoc regardless of how the PathDiagnosticLocation was specified? (PathDiagnosticLocation::asLocation).

We at least need to check if the target of the edge is the condition of a terminator.  But you are right, after that point it probably doesn't matter, but using statement-locations preserves an invariant through the rest of optimizeEdges in that we only remove edges for which we understand their semantic intent.  For example, some edges are added to closing braces, etc., and those are intended to never be removed.  We possibly don't want to preserve that invariant here.

> 
> 
> On May 22, 2013, at 11:52 , Ted Kremenek <kremenek at apple.com> wrote:
> 
>> +      PathPieces::iterator PieceToErase = I;
>> +      ++I;
>> +      erased = true;
>> +      path.erase(PieceToErase);
> 
> This is better written "I = path.erase(I)" (and still "erased = true", of course).

Got it.  Will fix.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130522/311e2f43/attachment.html>


More information about the cfe-commits mailing list