summaryrefslogtreecommitdiffstats
path: root/clang/utils
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
commit72e4b0b54c7d175cc91ed7588a68a5fa0b037004 (patch)
tree11d633c0403d1e4b8a91928165c01a213aaa2eb9 /clang/utils
parent7b5a6afb4455b8c41bfc7c8aa631f5e24352e126 (diff)
downloadbcm5719-llvm-72e4b0b54c7d175cc91ed7588a68a5fa0b037004.tar.gz
bcm5719-llvm-72e4b0b54c7d175cc91ed7588a68a5fa0b037004.zip
Include clang preprocessed sources as well with "crashes" output.
llvm-svn: 56601
Diffstat (limited to 'clang/utils')
-rwxr-xr-xclang/utils/ccc-analyzer15
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/utils/ccc-analyzer b/clang/utils/ccc-analyzer
index b3d59dfd7f2..4f76250b5d4 100755
--- a/clang/utils/ccc-analyzer
+++ b/clang/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);
}
OpenPOWER on IntegriCloud