[cfe-commits] r99684 - /cfe/trunk/tools/scan-build/scan-build
Ted Kremenek
kremenek at apple.com
Fri Mar 26 17:20:01 PDT 2010
Author: kremenek
Date: Fri Mar 26 19:20:01 2010
New Revision: 99684
URL: http://llvm.org/viewvc/llvm-project?rev=99684&view=rev
Log:
scan-build: set environment variable LDPLUSPLUS to 'c++-analyzer' to correctly link projects
with c++ code.
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=99684&r1=99683&r2=99684&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/scan-build (original)
+++ cfe/trunk/tools/scan-build/scan-build Fri Mar 26 19:20:01 2010
@@ -783,6 +783,7 @@
my $IgnoreErrors = shift;
my $Cmd = $Args->[0];
my $CCAnalyzer = shift;
+ my $CXXAnalyzer = shift;
# Get only the part of the command after the last '/'.
if ($Cmd =~ /\/([^\/]+)$/) {
@@ -809,12 +810,12 @@
$ENV{"CCC_CXX"} = $1;
}
shift @$Args;
- unshift @$Args, $CCAnalyzer;
+ unshift @$Args, $CXXAnalyzer;
}
elsif ($IgnoreErrors) {
if ($Cmd eq "make" or $Cmd eq "gmake") {
AddIfNotPresent($Args, "CC=$CCAnalyzer");
- AddIfNotPresent($Args, "CXX=$CCAnalyzer");
+ AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
AddIfNotPresent($Args,"-k");
AddIfNotPresent($Args,"-i");
}
@@ -845,7 +846,8 @@
# 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.
+ # (via c++-analyzer) when linking such files.
+ $ENV{"LDPLUSPLUS"} = $CXXAnalyzer;
}
return (system(@$Args) >> 8);
@@ -1232,9 +1234,8 @@
$ENV{'CCC_ANALYZER_OUTPUT_FORMAT'} = $OutputFormat;
}
-
# Run the build.
-my $ExitStatus = RunBuildCommand(\@ARGV, $IgnoreErrors, $Cmd);
+my $ExitStatus = RunBuildCommand(\@ARGV, $IgnoreErrors, $Cmd, $CmdCXX);
if (defined $OutputFormat) {
if ($OutputFormat =~ /plist/) {
More information about the cfe-commits
mailing list