diff options
Diffstat (limited to 'tools/scan-build')
-rwxr-xr-x[l---------] | tools/scan-build/c++-analyzer | 9 | ||||
-rwxr-xr-x | tools/scan-build/ccc-analyzer | 2 | ||||
-rwxr-xr-x | tools/scan-build/scan-build | 16 | ||||
-rw-r--r-- | tools/scan-build/scan-build.bat | 1 |
4 files changed, 23 insertions, 5 deletions
diff --git a/tools/scan-build/c++-analyzer b/tools/scan-build/c++-analyzer index ca10bf547dc2..dda5db9c7d92 120000..100755 --- a/tools/scan-build/c++-analyzer +++ b/tools/scan-build/c++-analyzer @@ -1 +1,8 @@ -ccc-analyzer
\ No newline at end of file +#!/usr/bin/env perl + +use Cwd qw/ abs_path /; +use File::Basename qw/ dirname /; +# Add scan-build dir to the list of places where perl looks for modules. +use lib dirname(abs_path($0)); + +do 'ccc-analyzer'; diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer index bb6dd9563b38..60b0185e6fb1 100755 --- a/tools/scan-build/ccc-analyzer +++ b/tools/scan-build/ccc-analyzer @@ -491,7 +491,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; } next; } - if ($Arg =~ /-msse.*/) { + if ($Arg =~ /-m.*/) { push @CompileOpts,$Arg; next; } diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build index 32eecc079e64..35f852e70b22 100755 --- a/tools/scan-build/scan-build +++ b/tools/scan-build/scan-build @@ -931,11 +931,13 @@ sub RunXcodebuild { if ($oldBehavior == 0) { my $OutputDir = $Options->{"OUTPUT_DIR"}; my $CLANG = $Options->{"CLANG"}; + my $OtherFlags = $Options->{"CCC_ANALYZER_ANALYSIS"}; push @$Args, "RUN_CLANG_STATIC_ANALYZER=YES", "CLANG_ANALYZER_OUTPUT=plist-html", "CLANG_ANALYZER_EXEC=$CLANG", - "CLANG_ANALYZER_OUTPUT_DIR=$OutputDir"; + "CLANG_ANALYZER_OUTPUT_DIR=$OutputDir", + "CLANG_ANALYZER_OTHER_FLAGS=$OtherFlags"; return (system(@$Args) >> 8); } @@ -1560,8 +1562,16 @@ if ($ForceDisplayHelp || $RequestDisplayHelp) { } $ClangCXX = $Clang; -$ClangCXX =~ s/\-\d+\.\d+$//; -$ClangCXX .= "++"; +# Determine operating system under which this copy of Perl was built. +my $IsWinBuild = ($^O =~/msys|cygwin|MSWin32/); +if($IsWinBuild) { + $ClangCXX =~ s/.exe$/++.exe/; +} +else { + $ClangCXX =~ s/\-\d+\.\d+$//; + $ClangCXX .= "++"; +} + # Make sure to use "" to handle paths with spaces. $ClangVersion = HtmlEscape(`"$Clang" --version`); diff --git a/tools/scan-build/scan-build.bat b/tools/scan-build/scan-build.bat new file mode 100644 index 000000000000..77be6746318f --- /dev/null +++ b/tools/scan-build/scan-build.bat @@ -0,0 +1 @@ +perl -S scan-build %*
|