summaryrefslogtreecommitdiffstats
path: root/tools/scan-build/ccc-analyzer
diff options
context:
space:
mode:
Diffstat (limited to 'tools/scan-build/ccc-analyzer')
-rwxr-xr-xtools/scan-build/ccc-analyzer25
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer
index 8717225..bb6dd95 100755
--- a/tools/scan-build/ccc-analyzer
+++ b/tools/scan-build/ccc-analyzer
@@ -31,11 +31,11 @@ my $DefaultCCompiler;
my $DefaultCXXCompiler;
if (`uname -a` =~ m/Darwin/) {
- $DefaultCCompiler = 'clang';
- $DefaultCXXCompiler = 'clang++';
+ $DefaultCCompiler = 'clang';
+ $DefaultCXXCompiler = 'clang++';
} else {
- $DefaultCCompiler = 'gcc';
- $DefaultCXXCompiler = 'g++';
+ $DefaultCCompiler = 'gcc';
+ $DefaultCXXCompiler = 'g++';
}
if ($FindBin::Script =~ /c\+\+-analyzer/) {
@@ -252,6 +252,7 @@ sub Analyze {
print $ofh $_;
print STDERR $_;
}
+ close $ofh;
waitpid($pid,0);
close(FROM_CHILD);
@@ -269,7 +270,7 @@ sub Analyze {
$HtmlDir, $ParserRejects, $ofile);
} else {
ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses,
- $HtmlDir, $OtherError, $ofile);
+ $HtmlDir, $OtherError, $ofile);
}
}
else {
@@ -389,6 +390,7 @@ my %LangMap = (
'cxx' => 'c++',
'txx' => 'c++',
'cc' => 'c++',
+ 'C' => 'c++',
'ii' => 'c++',
'i' => 'c-cpp-output',
'm' => 'objective-c',
@@ -489,6 +491,15 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; }
next;
}
+ if ($Arg =~ /-msse.*/) {
+ push @CompileOpts,$Arg;
+ next;
+ }
+ # Handle the case where there isn't a space after -iquote
+ if ($Arg =~ /-iquote.*/) {
+ push @CompileOpts,$Arg;
+ next;
+ }
# Options with possible arguments that should pass through to linker.
if (defined $LinkerOptionMap{$ArgKey}) {
@@ -617,7 +628,7 @@ if ($Action eq 'compile' or $Action eq 'link') {
my @Archs = keys %ArchsSeen;
# Skip the file if we don't support the architectures specified.
exit 0 if ($HadArch && scalar(@Archs) == 0);
-
+
foreach my $file (@Files) {
# Determine the language for the file.
my $FileLang = $Lang;
@@ -671,7 +682,7 @@ if ($Action eq 'compile' or $Action eq 'link') {
$ResultFile = $f;
# If the HtmlDir is not set, we sould clean up the plist files.
if (!defined $HtmlDir || -z $HtmlDir) {
- $CleanupFile = $f;
+ $CleanupFile = $f;
}
}
}
OpenPOWER on IntegriCloud