]> granicus.if.org Git - clang/commitdiff
List the function/method name in the index page of scan-build
authorSylvestre Ledru <sylvestre@debian.org>
Sat, 14 Jun 2014 08:49:40 +0000 (08:49 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sat, 14 Jun 2014 08:49:40 +0000 (08:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210971 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
tools/scan-build/scan-build

index c176ab3f557c4fbf8b6e51ab11866477bc56d3a4..2a4554648220442000ca13204fe44a0bb4569004 100644 (file)
@@ -240,6 +240,10 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,
 
     os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";
 
+    os << "\n<!-- FILENAME " << llvm::sys::path::filename(Entry->getName()) << " -->\n";
+
+    os  << "\n<!-- FUNCTIONNAME " <<  declName << " -->\n";
+
     os << "\n<!-- BUGLINE "
        << LineNumber
        << " -->\n";
index f46f0933c0816ea4d74e366282b6deeabb008a81..862bd3a4ca3294ee9ba5bcd420bed8e17c8984f8 100755 (executable)
@@ -368,6 +368,7 @@ sub ScanFile {
 
   my $BugType        = "";
   my $BugFile        = "";
+  my $BugFunction    = "";
   my $BugCategory    = "";
   my $BugDescription = "";
   my $BugPathLength  = 1;
@@ -395,8 +396,13 @@ sub ScanFile {
     elsif (/<!-- BUGDESC (.*) -->$/) {
       $BugDescription = $1;
     }
+    elsif (/<!-- FUNCTIONNAME (.*) -->$/) {
+      $BugFunction = $1;
+    }
+
   }
 
+
   close(IN);
 
   if (!defined $BugCategory) {
@@ -409,7 +415,7 @@ sub ScanFile {
     return;
   }
 
-  push @$Index,[ $FName, $BugCategory, $BugType, $BugFile, $BugLine,
+  push @$Index,[ $FName, $BugCategory, $BugType, $BugFile, $BugFunction, $BugLine,
                  $BugPathLength ];
 }
 
@@ -701,6 +707,7 @@ print OUT <<ENDTEXT;
   <td>Bug Group</td>
   <td class="sorttable_sorted">Bug Type<span id="sorttable_sortfwdind">&nbsp;&#x25BE;</span></td>
   <td>File</td>
+  <td>Function/Method</td>
   <td class="Q">Line</td>
   <td class="Q">Path Length</td>
   <td class="sorttable_nosort"></td>
@@ -758,13 +765,17 @@ ENDTEXT
       }
       print OUT "</td>";
 
+      print OUT "<td class=\"DESC\">";
+      print OUT $row->[4];
+      print OUT "</td>";
+
       # Print out the quantities.
-      for my $j ( 4 .. 5 ) {
+      for my $j ( 5 .. 6 ) {
         print OUT "<td class=\"Q\">$row->[$j]</td>";
       }
 
       # Print the rest of the columns.
-      for (my $j = 6; $j <= $#{$row}; ++$j) {
+      for (my $j = 7; $j <= $#{$row}; ++$j) {
         print OUT "<td>$row->[$j]</td>"
       }