diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-23 22:22:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-23 22:22:49 +0000 |
commit | 36a32ebce864bdbc7f3ad319640097ca0168936d (patch) | |
tree | f7cca8ff8d2990d6ddb0b04b653c63e71e72751a /lib/Analysis/BugReporter.cpp | |
parent | d6f584ff262f51b40f4c9e317b13f1f21db29755 (diff) |
Output summary diagnostic for each bug report.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r-- | lib/Analysis/BugReporter.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index e3735670cf..9d4d059341 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -738,19 +738,20 @@ void BugReporter::EmitWarning(BugReport& R) { PathDiagnosticClient* PD = getPathDiagnosticClient(); if (PD && !D->empty()) { - PD->HandlePathDiagnostic(D.take()); - return; + PD->HandlePathDiagnostic(D.take()); + // Output a diagnostic summarizing the report. + Diagnostic& Diag = getDiagnostic(); + Diag.Report(R.getLocation(getSourceManager()), + Diag.getCustomDiagID(Diagnostic::Warning,R.getDescription())); + return; } - // We don't have a PathDiagnosticClient, but we can still emit a single + // This isn't a bug with a path, but we can still emit a single // line diagnostic. Determine the location. - FullSourceLoc L = D->empty() ? R.getLocation(getSourceManager()) : D->back()->getLocation(); - - // Determine the range. - + // Determine the range. const SourceRange *Beg, *End; if (!D->empty()) { @@ -768,6 +769,10 @@ void BugReporter::EmitWarning(BugReport& R) { D->push_back(piece); PD->HandlePathDiagnostic(D.take()); + + // Output a diagnostic summarizing the report. + Diagnostic& Diag = getDiagnostic(); + Diag.Report(L,Diag.getCustomDiagID(Diagnostic::Warning,R.getDescription())); return; } else { |