diff options
| author | Ted Kremenek <kremenek@apple.com> | 2013-05-04 01:12:55 +0000 | 
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2013-05-04 01:12:55 +0000 | 
| commit | 74c0d388e8c1feaf08856a7ec0149f3d77891921 (patch) | |
| tree | c186e8bade17d82e565e3e9c9c008c7e2880462a | |
| parent | 881e9d62e270e7cb4c6fb3f59b1173600268852f (diff) | |
| download | bcm5719-llvm-74c0d388e8c1feaf08856a7ec0149f3d77891921.tar.gz bcm5719-llvm-74c0d388e8c1feaf08856a7ec0149f3d77891921.zip  | |
[analyzer;alternate edges] - add in events (loop iterations, etc)
These were being dropped due a transcription mistake from the original
algorithm.
llvm-svn: 181083
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 22 | 
1 files changed, 15 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 4606b2151db..1df4970f6e4 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1595,6 +1595,12 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,            reversePropagateIntererstingSymbols(*PDB.getBugReport(), IE,                                                N->getState().getPtr(), Ex,                                                N->getLocationContext()); + +        PathDiagnosticLocation L = +         cleanUpLocation(PathDiagnosticLocation::createBegin(PS->getStmt(), SM, +                                                             LC), LC); + +        addEdgeToPath(PD.getActivePath(), PrevLoc, L, LC);          break;        } @@ -1686,6 +1692,7 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,            p->setPrunable(true);            addEdgeToPath(PD.getActivePath(), PrevLoc, p->getLocation(), LC); +          PD.getActivePath().push_front(p);            if (CS) {              addEdgeToPath(PD.getActivePath(), PrevLoc, @@ -1706,12 +1713,13 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,                                                N),                              Term))            { -              PathDiagnosticLocation L(Term, SM, PDB.LC); -              PathDiagnosticEventPiece *PE = +            PathDiagnosticLocation L(Term, SM, PDB.LC); +            PathDiagnosticEventPiece *PE =                new PathDiagnosticEventPiece(L, "Loop body executed 0 times"); -              PE->setPrunable(true); -              addEdgeToPath(PD.getActivePath(), PrevLoc, -                            PE->getLocation(), LC); +            PE->setPrunable(true); +            addEdgeToPath(PD.getActivePath(), PrevLoc, +                          PE->getLocation(), LC); +            PD.getActivePath().push_front(PE);            }          }          break; @@ -1722,12 +1730,12 @@ GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,        continue;      // Add pieces from custom visitors. -    BugReport *R = PDB.getBugReport();      for (ArrayRef<BugReporterVisitor *>::iterator I = visitors.begin(),           E = visitors.end();           I != E; ++I) { -      if (PathDiagnosticPiece *p = (*I)->VisitNode(N, NextNode, PDB, *R)) { +      if (PathDiagnosticPiece *p = (*I)->VisitNode(N, NextNode, PDB, *report)) {          addEdgeToPath(PD.getActivePath(), PrevLoc, p->getLocation(), LC); +        PD.getActivePath().push_front(p);          updateStackPiecesWithMessage(p, CallStack);        }      }  | 

