aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-25 00:51:44 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-25 00:51:44 +0000
commitc3998fa64e254b13669e8cf3a0cf23eb4f73b88b (patch)
tree008f4a4f069ac81b8e93725b25dc363d81fb37c0
parent82a1253077cd0832e4d347062b911cd305ab62d1 (diff)
Include clang preprocessed sources as well with "crashes" output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56601 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xutils/ccc-analyzer15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer
index b3d59dfd7f..4f76250b5d 100755
--- a/utils/ccc-analyzer
+++ b/utils/ccc-analyzer
@@ -32,15 +32,24 @@ sub GetPPExt {
}
sub ProcessClangFailure {
- my ($Lang, $file, $Args, $HtmlDir, $ErrorType, $ofile) = @_;
+ my ($Clang, $Lang, $file, $Args, $HtmlDir, $ErrorType, $ofile) = @_;
my $Dir = "$HtmlDir/crashes";
mkpath $Dir;
+
+ # Generate the preprocessed file with cc (i.e., gcc).
my ($PPH, $PPFile) = tempfile("clang_crash_XXXXXX",
SUFFIX => GetPPExt($Lang),
DIR => $Dir);
system $CC, @$Args, "-E", "-o", $PPFile;
close ($PPH);
+
+ # Generate the preprocessed file with clang.
+ my $PPFile_Clang = $PPFile;
+ $PPFile_Clang =~ s/[.](.+)$/.clang.$1/;
+ system $Clang, @$Args, "-E", "-o", "$PPFile_Clang";
+
+ # Create the info file.
open (OUT, ">", "$PPFile.info.txt") or die "Cannot open $PPFile.info.txt\n";
print OUT abs_path($file), "\n";
print OUT "$ErrorType\n";
@@ -139,11 +148,11 @@ sub Analyze {
# Did the command die because of a signal?
if ($Result & 127 and $Cmd eq $Clang and defined $HtmlDir) {
- ProcessClangFailure($Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
+ ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
"Crash", $ofile);
}
elsif ($Result) {
- ProcessClangFailure($Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
+ ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, $HtmlDir,
"Parser Rejects", $ofile);
}