return ".i";
}
-sub ProcessClangCrash {
- my ($Clang, $Lang, $file, $Args, $HtmlDir) = @_;
+sub ProcessClangFailure {
+ my ($Lang, $file, $Args, $HtmlDir, $ErrorType) = @_;
my $Dir = "$HtmlDir/crashes";
mkpath $Dir;
my ($PPH, $PPFile) = tempfile("clang_crash_XXXXXX",
SUFFIX => GetPPExt($Lang),
DIR => $Dir);
- system $Clang, @$Args, "-E", "-o", $PPFile;
+ system "gcc", @$Args, "-E", "-o", $PPFile;
close ($PPH);
open (OUT, ">", "$PPFile.info") or die "Cannot open $PPFile.info\n";
- print OUT "$file";
+ print OUT "$file\n";
+ print OUT "$ErrorType\n";
close OUT;
}
# Skip anything related to C++.
return if ($Lang =~ /c[+][+]/);
-
+
my $RunAnalyzer = 0;
my $Cmd;
my @CmdArgs;
# Did the command die because of a signal?
if ($? & 127 and $Cmd eq $Clang and defined $HtmlDir) {
- ProcessClangCrash($Clang, $Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir);
+ ProcessClangFailure($Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
+ "Crash");
+ }
+ elsif ($?) {
+ ProcessClangFailure($Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
+ "Parser Rejects");
}
}
if (scalar(@files)) {
print OUT <<ENDTEXT;
-<h3>Analyzer Crashes</h3>
+<h3>Analyzer Failures</h3>
-<p>The analyzer crashed while processing the following files:</p>
+<p>The analyzer had problems processing the following files:</p>
<table>
-<thead><tr><td>Source File</td><td>Preprocessed File</td></tr></thead>
+<thead><tr><td>Problem</td><td>Source File</td><td>Preprocessed File</td></tr></thead>
ENDTEXT
foreach my $file (sort @files) {
open (INFO, "$Dir/crashes/$file") or
die "Cannot open $Dir/crashes/$file\n";
my $srcfile = <INFO>;
+ chomp $srcfile;
+ my $problem = <INFO>;
+ chomp $problem;
close (INFO);
# Print the information in the table.
- print OUT "<tr><td>$srcfile</td><td class=\"View\"><a href=\"crashes/$ppfile\">View</a></td></tr>\n";
+ print OUT "<tr><td>$problem</td><td>$srcfile</td><td class=\"View\"><a href=\"crashes/$ppfile\">View</a></td></tr>\n";
}
print OUT <<ENDTEXT;