]> granicus.if.org Git - clang/commitdiff
[analyzer] Fix for PR24112 (scan-build doesn't work with --use-analyzer="path to...
authorAnton Yartsev <anton.yartsev@gmail.com>
Thu, 20 Aug 2015 21:52:39 +0000 (21:52 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Thu, 20 Aug 2015 21:52:39 +0000 (21:52 +0000)
Don't derive the path_to_clang++ from the path_to_clang if the path_to_clang is really the path_to_clang++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245621 91177308-0d34-0410-b5e6-96231b3b80d8

tools/scan-build/scan-build

index 8c4c14dbeb3a81100c31b88fc150f9d93b8cbd95..b3a4008dee883b71798e00669104288ac59a44f1 100755 (executable)
@@ -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.