diff options
| author | Anton Yartsev <anton.yartsev@gmail.com> | 2015-08-20 21:52:39 +0000 |
|---|---|---|
| committer | Anton Yartsev <anton.yartsev@gmail.com> | 2015-08-20 21:52:39 +0000 |
| commit | c971a1a6d545770eb6e2cb4e5f2c539864bfd510 (patch) | |
| tree | 9a7a37ba5b4d866e50aa91f9ba8fbb9c62756cca | |
| parent | 480bc9fc36ac39607a5850941705efb691b7ac92 (diff) | |
| download | bcm5719-llvm-c971a1a6d545770eb6e2cb4e5f2c539864bfd510.tar.gz bcm5719-llvm-c971a1a6d545770eb6e2cb4e5f2c539864bfd510.zip | |
[analyzer] Fix for PR24112 (scan-build doesn't work with --use-analyzer="path to clang++.exe").
Don't derive the path_to_clang++ from the path_to_clang if the path_to_clang is really the path_to_clang++.
llvm-svn: 245621
| -rwxr-xr-x | clang/tools/scan-build/scan-build | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/clang/tools/scan-build/scan-build b/clang/tools/scan-build/scan-build index 8c4c14dbeb3..b3a4008dee8 100755 --- a/clang/tools/scan-build/scan-build +++ b/clang/tools/scan-build/scan-build @@ -1646,14 +1646,20 @@ if ($ForceDisplayHelp || $RequestDisplayHelp) { } $ClangCXX = $Clang; -# 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 .= "++"; +if ($Clang !~ /\+\+(\.exe)?$/) { + # If $Clang holds the name of the clang++ executable then we leave + # $ClangCXX and $Clang equal, otherwise construct the name of the clang++ + # executable from the clang executable name. + + # 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. |

