[cfe-commits] r55327 - /cfe/trunk/utils/scan-build

Ted Kremenek kremenek at apple.com
Mon Aug 25 13:45:07 PDT 2008


Author: kremenek
Date: Mon Aug 25 15:45:07 2008
New Revision: 55327

URL: http://llvm.org/viewvc/llvm-project?rev=55327&view=rev
Log:
Use path information from .info files when computing common prefix information.
This partially implements PR 2705: http://llvm.org/bugs/show_bug.cgi?id=2705

Modified:
    cfe/trunk/utils/scan-build

Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=55327&r1=55326&r2=55327&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Mon Aug 25 15:45:07 2008
@@ -409,6 +409,20 @@
   my @Index;    
   foreach my $file (@files) { ScanFile(\@Index, $Dir, $file); }
   
+  # Scan the crashes directory and use the information in the .info files
+  # to update the common prefix directory.
+  if (-d "$Dir/crashes") {
+    opendir(DIR, "$Dir/crashes");
+    my @files = grep { /[.]info$/; } readdir(DIR);
+    closedir(DIR);
+    foreach my $file (@files) {
+      open IN, "$Dir/crashes/$file" or DieDiag("cannot open $file\n");
+      my $Path = <IN>;
+      if (defined $Path) { UpdatePrefix($Path); }
+      close IN;
+    }    
+  }
+  
   # Generate an index.html file.  
   my $FName = "$Dir/index.html";  
   open(OUT, ">", $FName) or DieDiag("Cannot create file '$FName'\n");
@@ -588,6 +602,8 @@
         chomp $problem;
         close (INFO);
         # Print the information in the table.
+        my $prefix = GetPrefix();
+        if (defined $prefix) { $srcfile =~ s/^$prefix//; }        
         print OUT "<tr><td>$problem</td><td>$srcfile</td><td class=\"View\"><a href=\"crashes/$ppfile\">View</a></td></tr>\n";
       }
 
@@ -729,9 +745,10 @@
  -V             - View analysis results in a web browser when the build
  --view           completes.
 
-ENDTEXT
 
-  print " Available Source Code Analyses (multiple analyses may be specified):\n\n";
+ Available Source Code Analyses (multiple analyses may be specified):
+
+ENDTEXT
 
   foreach my $Analysis (sort keys %AvailableAnalyses) {
     if (defined $AnalysesDefaultEnabled{$Analysis}) {





More information about the cfe-commits mailing list