From: Ted Kremenek Date: Fri, 23 Jan 2009 22:22:49 +0000 (+0000) Subject: Output summary diagnostic for each bug report. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36a32ebce864bdbc7f3ad319640097ca0168936d;p=clang Output summary diagnostic for each bug report. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62885 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 {