summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-03-16 01:07:47 +0000
committerJordan Rose <jordan_rose@apple.com>2013-03-16 01:07:47 +0000
commit53159311057b0d977f2bf11a93ec0577af534c03 (patch)
tree514c4b38f5d4e9268717431e022ad43947cf1247 /clang/lib/StaticAnalyzer
parent50b5ee50238fbd8ea5633204a21723825786c00c (diff)
downloadbcm5719-llvm-53159311057b0d977f2bf11a93ec0577af534c03.tar.gz
bcm5719-llvm-53159311057b0d977f2bf11a93ec0577af534c03.zip
[analyzer] Don't repeat a bug equivalence class if every report is invalid.
I removed this check in the recursion->iteration commit, but forgot that generatePathDiagnostic may be called multiple times if there are multiple PathDiagnosticConsumers. llvm-svn: 177214
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index 1dca2b5206e..46108f44ea4 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -2114,13 +2114,23 @@ bool GRBugReporter::generatePathDiagnostic(PathDiagnostic& PD,
ArrayRef<BugReport *> &bugReports) {
assert(!bugReports.empty());
+ bool HasValid = false;
SmallVector<const ExplodedNode *, 32> errorNodes;
for (ArrayRef<BugReport*>::iterator I = bugReports.begin(),
- E = bugReports.end();
- I != E; ++I) {
- errorNodes.push_back((*I)->getErrorNode());
+ E = bugReports.end(); I != E; ++I) {
+ if ((*I)->isValid()) {
+ HasValid = true;
+ errorNodes.push_back((*I)->getErrorNode());
+ } else {
+ errorNodes.push_back(0);
+ }
}
+ // If all the reports have been marked invalid by a previous path generation,
+ // we're done.
+ if (!HasValid)
+ return false;
+
typedef PathDiagnosticConsumer::PathGenerationScheme PathGenerationScheme;
PathGenerationScheme ActiveScheme = PC.getGenerationScheme();
OpenPOWER on IntegriCloud