]> granicus.if.org Git - clang/commitdiff
Two changes to scan-build:
authorTed Kremenek <kremenek@apple.com>
Fri, 12 Feb 2010 00:12:25 +0000 (00:12 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 12 Feb 2010 00:12:25 +0000 (00:12 +0000)
(1) When no 'clang' is found with 'scan-build', remember the one from
the path as scan-build sees it, not the build system.  This prevents
us from finding different clangs during the build.

(2) Don't set LDPLUSPLUS when running xcodebuild; instead rely on the
clang driver to do the right thing.

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

tools/scan-build/scan-build

index 7f05de2394d9453df389dc44f3927aca525323c4..432456b15fe763b6706bc1c981982b4741570990 100755 (executable)
@@ -88,7 +88,11 @@ if (!defined $ClangSB || ! -x $ClangSB) {
 my $Clang;
 if (!defined $ClangSB || ! -x $ClangSB) {
   # Default to looking for 'clang' in the path.
-  $Clang = "clang";
+  $Clang = `which clang`;
+  chomp $Clang;
+  if ($Clang eq "") {
+    DieDiag("No 'clang' executable found in path.");
+  }
 }
 else {
   $Clang = $ClangSB;
@@ -842,10 +846,6 @@ sub RunBuildCommand {
     # When 'CC' is set, xcodebuild uses it to do all linking, even if we are
     # linking C++ object files.  Set 'LDPLUSPLUS' so that xcodebuild uses 'g++'
     # when linking such files.
-    if (!defined $ENV{'CCC_CXX'}) {
-      $ENV{'CCC_CXX'} = 'g++';      
-    }
-    $ENV{'LDPLUSPLUS'} = $ENV{'CCC_CXX'};
   }
   
   return (system(@$Args) >> 8);
@@ -1192,7 +1192,7 @@ if (!defined $CmdCXX || ! -x $CmdCXX) {
 
 if (!defined $ClangSB || ! -x $ClangSB) {
   Diag("'clang' executable not found in '$RealBin/bin'.\n");
-  Diag("Using 'clang' from path.\n");
+  Diag("Using 'clang' from path: $Clang\n");
 }
 
 $ENV{'CC'} = $Cmd;