From: Ted Kremenek Date: Tue, 7 May 2013 21:11:52 +0000 (+0000) Subject: [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98fb1cca0eccb9cd8b40756907f0c27c9be791be;p=clang [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181357 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index 7ee172a7f9..225b913f81 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1723,12 +1723,6 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD, // 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(Loop)) - CS = dyn_cast(FS->getBody()); - else if (const WhileStmt *WS = dyn_cast(Loop)) - CS = dyn_cast(WS->getBody()); PathDiagnosticEventPiece *p = new PathDiagnosticEventPiece(L, "Looping back to the head " @@ -1738,11 +1732,6 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD, 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();