summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-21 21:47:09 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-21 21:47:09 +0000
commitb57efcc3d0e1442d618d238f230872b5923e97bd (patch)
tree847a9573b78b6fad898cd0764069cecc87ac6d5d
parentc360f3ba5055c4b4d9e208ed79e8caa1366ff8cc (diff)
downloadbcm5719-llvm-b57efcc3d0e1442d618d238f230872b5923e97bd.tar.gz
bcm5719-llvm-b57efcc3d0e1442d618d238f230872b5923e97bd.zip
Added --use-cc option to scan-build to allow the user to specify what compiler they want to use for code compilation.
llvm-svn: 55142
-rwxr-xr-xclang/utils/ccc-analyzer4
-rwxr-xr-xclang/utils/scan-build22
2 files changed, 25 insertions, 1 deletions
diff --git a/clang/utils/ccc-analyzer b/clang/utils/ccc-analyzer
index d41978c01fd..c760a864fdd 100755
--- a/clang/utils/ccc-analyzer
+++ b/clang/utils/ccc-analyzer
@@ -184,7 +184,9 @@ my $Lang;
my $Output;
# Forward arguments to gcc.
-my $Status = system("gcc",@ARGV);
+my $CC = $ENV{'CCC_CC'};
+if (!defined $CC) { $CC = "gcc"; }
+my $Status = system($CC,@ARGV);
if ($Status) { exit($Status); }
# Get the analysis options.
diff --git a/clang/utils/scan-build b/clang/utils/scan-build
index 44c2db3f0dc..d04c2897e9d 100755
--- a/clang/utils/scan-build
+++ b/clang/utils/scan-build
@@ -719,6 +719,10 @@ OPTIONS:
exit status of $Prog to be 1 if it found potential bugs
and 0 otherwise.
+ --use-cc [compiler path] - By default, $Prog uses 'gcc' to compile
+ --use-cc=[compiler path] your code. This option specifies what compiler
+ to use for regular code compilation.
+
-v - Verbose output from $Prog and the analyzer.
A second and third "-v" increases verbosity.
@@ -811,6 +815,24 @@ while (@ARGV) {
next;
}
+ if ($arg =~ /^--use-cc(=(.+))?$/) {
+ shift @ARGV;
+ my $cc;
+
+ if ($2 eq "") {
+ if (!@ARGV) {
+ DieDiag("'--use-cc' option requires a compiler executable name.\n");
+ }
+ $cc = shift @ARGV;
+ }
+ else {
+ $cc = $2;
+ }
+
+ $ENV{"CCC_CC"} = $cc;
+ next;
+ }
+
if ($arg eq "-v") {
shift @ARGV;
$Verbose++;
OpenPOWER on IntegriCloud