[cfe-commits] r144029 - /cfe/trunk/tools/scan-build/ccc-analyzer
Anna Zaks
ganna at apple.com
Mon Nov 7 14:38:10 PST 2011
Author: zaks
Date: Mon Nov 7 16:38:10 2011
New Revision: 144029
URL: http://llvm.org/viewvc/llvm-project?rev=144029&view=rev
Log:
[analyzer] Make sure scan-build catches all clang failures.
scan-build ignores clang failures in some cases, which might lead to
silent failure suppression. For example, if clang command line
argument is wrong. (Addresses radar://10406598)
Modified:
cfe/trunk/tools/scan-build/ccc-analyzer
Modified: cfe/trunk/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=144029&r1=144028&r2=144029&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/ccc-analyzer Mon Nov 7 16:38:10 2011
@@ -78,8 +78,8 @@
# Set this to 1 if we want to include 'parser rejects' files.
my $IncludeParserRejects = 0;
my $ParserRejects = "Parser Rejects";
-
my $AttributeIgnored = "Attribute Ignored";
+my $OtherError = "Other Error";
sub ProcessClangFailure {
my ($Clang, $Lang, $file, $Args, $HtmlDir, $ErrorType, $ofile) = @_;
@@ -93,6 +93,9 @@
elsif ($ErrorType eq $AttributeIgnored) {
$prefix = "clang_attribute_ignored";
}
+ elsif ($ErrorType eq $OtherError) {
+ $prefix = "clang_other_error";
+ }
# Generate the preprocessed file with Clang.
my ($PPH, $PPFile) = tempfile( $prefix . "_XXXXXX",
@@ -259,6 +262,9 @@
if ($IncludeParserRejects && !($file =~/conftest/)) {
ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses,
$HtmlDir, $ParserRejects, $ofile);
+ } else {
+ ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses,
+ $HtmlDir, $OtherError, $ofile);
}
}
else {
More information about the cfe-commits
mailing list