r209526 - List the function/method name in the index page of scan-build
Sylvestre Ledru
sylvestre at debian.org
Fri May 23 09:40:47 PDT 2014
Author: sylvestre
Date: Fri May 23 11:40:46 2014
New Revision: 209526
URL: http://llvm.org/viewvc/llvm-project?rev=209526&view=rev
Log:
List the function/method name in the index page of scan-build
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
cfe/trunk/tools/scan-build/scan-build
Modified: cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp?rev=209526&r1=209525&r2=209526&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp Fri May 23 11:40:46 2014
@@ -215,6 +215,10 @@ void HTMLDiagnostics::ReportDiag(const P
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 "
<< path.back()->getLocation().asLocation().getExpansionLineNumber()
<< " -->\n";
Modified: cfe/trunk/tools/scan-build/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/scan-build?rev=209526&r1=209525&r2=209526&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/scan-build (original)
+++ cfe/trunk/tools/scan-build/scan-build Fri May 23 11:40:46 2014
@@ -368,6 +368,7 @@ sub ScanFile {
my $BugType = "";
my $BugFile = "";
+ my $BugFunction = "";
my $BugCategory = "";
my $BugDescription = "";
my $BugPathLength = 1;
@@ -395,6 +396,10 @@ sub ScanFile {
elsif (/<!-- BUGDESC (.*) -->$/) {
$BugDescription = $1;
}
+ elsif (/<!-- FUNCTIONNAME (.*) -->$/) {
+ $BugFunction = $1;
+ }
+
}
close(IN);
@@ -409,7 +414,7 @@ sub ScanFile {
return;
}
- push @$Index,[ $FName, $BugCategory, $BugType, $BugFile, $BugLine,
+ push @$Index,[ $FName, $BugCategory, $BugType, $BugFile, $BugFunction, $BugLine,
$BugPathLength ];
}
@@ -699,6 +704,7 @@ print OUT <<ENDTEXT;
<td>Bug Group</td>
<td class="sorttable_sorted">Bug Type<span id="sorttable_sortfwdind"> ▾</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>
@@ -756,13 +762,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>"
}
More information about the cfe-commits
mailing list