[cfe-commits] r49486 - in /cfe/trunk: lib/Analysis/BugReporter.cpp utils/ccc-analyzer

Ted Kremenek kremenek at apple.com
Thu Apr 10 09:12:38 PDT 2008


Author: kremenek
Date: Thu Apr 10 11:12:38 2008
New Revision: 49486

URL: http://llvm.org/viewvc/llvm-project?rev=49486&view=rev
Log:
When not emitting path diagnostics in BugReporter::EmitWarning(), use the
BugReport-specific SourceRanges (when available).

Modified:
    cfe/trunk/lib/Analysis/BugReporter.cpp
    cfe/trunk/utils/ccc-analyzer

Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=49486&r1=49485&r2=49486&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Thu Apr 10 11:12:38 2008
@@ -358,8 +358,18 @@
   if (!S)
     return;
   
-  SourceRange Range = S->getSourceRange();
+  const SourceRange *Beg, *End;
+  R.getRanges(Beg, End);
+  
+  if (Beg == End) {
+    SourceRange Range = S->getSourceRange();
+    
+    Diag.Report(FullSourceLoc(S->getLocStart(), Ctx.getSourceManager()),
+                ErrorDiag, NULL, 0, &Range, 1);   
+    
+  }
+  else
+    Diag.Report(FullSourceLoc(S->getLocStart(), Ctx.getSourceManager()),
+                ErrorDiag, NULL, 0, Beg, End - Beg);
   
-  Diag.Report(FullSourceLoc(S->getLocStart(), Ctx.getSourceManager()),
-              ErrorDiag, NULL, 0, &Range, 1);   
 }

Modified: cfe/trunk/utils/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ccc-analyzer?rev=49486&r1=49485&r2=49486&view=diff

==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Thu Apr 10 11:12:38 2008
@@ -74,7 +74,7 @@
       command = 'cp'.split()
       args = command + files + target.split()      
     else:
-      command = 'clang --grsimple'.split()
+      command = 'clang -check-cfref'.split()
       args = command + args;
       
       if htmldir is not None:





More information about the cfe-commits mailing list