]> granicus.if.org Git - clang/commitdiff
[analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no...
authorTed Kremenek <kremenek@apple.com>
Tue, 7 May 2013 21:11:52 +0000 (21:11 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 7 May 2013 21:11:52 +0000 (21:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181357 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporter.cpp

index 7ee172a7f9f4355c4a22cc5814b3594ddeaa3e74..225b913f813934ca3ad04bf665b8724762847116 100644 (file)
@@ -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<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(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();