r245621 - [analyzer] Fix for PR24112 (scan-build doesn't work with --use-analyzer="path to clang++.exe").

Anton Yartsev via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 14:52:39 PDT 2015


Author: ayartsev
Date: Thu Aug 20 16:52:39 2015
New Revision: 245621

URL: http://llvm.org/viewvc/llvm-project?rev=245621&view=rev
Log:
[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++.

Modified:
    cfe/trunk/tools/scan-build/scan-build

Modified: cfe/trunk/tools/scan-build/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/scan-build?rev=245621&r1=245620&r2=245621&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/scan-build (original)
+++ cfe/trunk/tools/scan-build/scan-build Thu Aug 20 16:52:39 2015
@@ -1646,14 +1646,20 @@ if ($ForceDisplayHelp || $RequestDisplay
 }
 
 $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.




More information about the cfe-commits mailing list