aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-11-07 22:38:10 +0000
committerAnna Zaks <ganna@apple.com>2011-11-07 22:38:10 +0000
commit1a8a8cbea639d0519f06285e12f64904d1158305 (patch)
treec1f6c0883c61e93cc9ecdb447588517b18428c88
parent66f85713bd0d22f867efa8e9fb0037befdd6b151 (diff)
[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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144029 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xtools/scan-build/ccc-analyzer8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer
index c39e417951..fa2bff091c 100755
--- a/tools/scan-build/ccc-analyzer
+++ b/tools/scan-build/ccc-analyzer
@@ -78,8 +78,8 @@ sub GetPPExt {
# 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 @@ sub ProcessClangFailure {
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 @@ sub Analyze {
if ($IncludeParserRejects && !($file =~/conftest/)) {
ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses,
$HtmlDir, $ParserRejects, $ofile);
+ } else {
+ ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses,
+ $HtmlDir, $OtherError, $ofile);
}
}
else {