]> granicus.if.org Git - clang/commitdiff
Output summary diagnostic for each bug report.
authorTed Kremenek <kremenek@apple.com>
Fri, 23 Jan 2009 22:22:49 +0000 (22:22 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 23 Jan 2009 22:22:49 +0000 (22:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62885 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BugReporter.cpp

index e3735670cf63fbbcc109ddf9eeac595295bb868b..9d4d059341b52d879012bfb394401ec7a40fce4d 100644 (file)
@@ -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 {