From 6492200c313937adf8c9dd206790933a228e3ef3 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 12 Feb 2010 00:12:25 +0000 Subject: [PATCH] Two changes to scan-build: (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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build index 7f05de2394..432456b15f 100755 --- a/tools/scan-build/scan-build +++ b/tools/scan-build/scan-build @@ -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; -- 2.40.0