r181357 - [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value.
Ted Kremenek
kremenek at apple.com
Tue May 7 21:52:04 PDT 2013
Yeah I'm mixed on this one as well. It's trivial to add back. I'll continue to experiment with the edges to see how this feels in practice.
On May 7, 2013, at 2:27 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> Depending on how the loop-back-to-top arrow is drawn, this might not be the case. If it's drawn along the left edge (for a while loop), I'd rather have it come from the close brace. If it's drawn along the right edge (for a for loop), this is less important.
>
> ...then again, the arrow should not go to the close brace after a 'continue'. So...
>
>
> On May 7, 2013, at 14:11 , Ted Kremenek <kremenek at apple.com> wrote:
>
>> Author: kremenek
>> Date: Tue May 7 16:11:52 2013
>> New Revision: 181357
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=181357&view=rev
>> Log:
>> [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value.
>>
>> Modified:
>> cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
>>
>> Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=181357&r1=181356&r2=181357&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
>> +++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Tue May 7 16:11:52 2013
>> @@ -1723,12 +1723,6 @@ GenerateAlternateExtensivePathDiagnostic
>> // Are we jumping to the head of a loop? Add a special diagnostic.
>> if (const Stmt *Loop = BE->getSrc()->getLoopTarget()) {
>> PathDiagnosticLocation L(Loop, SM, PDB.LC);
>> - const CompoundStmt *CS = NULL;
>> -
>> - if (const ForStmt *FS = dyn_cast<ForStmt>(Loop))
>> - CS = dyn_cast<CompoundStmt>(FS->getBody());
>> - else if (const WhileStmt *WS = dyn_cast<WhileStmt>(Loop))
>> - CS = dyn_cast<CompoundStmt>(WS->getBody());
>>
>> PathDiagnosticEventPiece *p =
>> new PathDiagnosticEventPiece(L, "Looping back to the head "
>> @@ -1738,11 +1732,6 @@ GenerateAlternateExtensivePathDiagnostic
>> addEdgeToPath(PD.getActivePath(), PrevLoc, p->getLocation(), LC);
>> PD.getActivePath().push_front(p);
>> EventCategory[p] = EC_LoopingBack;
>> -
>> - if (CS) {
>> - addEdgeToPath(PD.getActivePath(), PrevLoc,
>> - PathDiagnosticLocation::createEndBrace(CS, SM), LC);
>> - }
>> }
>>
>> const CFGBlock *BSrc = BE->getSrc();
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130507/b2456d79/attachment.html>
More information about the cfe-commits
mailing list