[cfe-commits] r56618 - /cfe/trunk/utils/ccc-analyzer
Ted Kremenek
kremenek at apple.com
Thu Sep 25 13:18:01 PDT 2008
Author: kremenek
Date: Thu Sep 25 15:17:57 2008
New Revision: 56618
URL: http://llvm.org/viewvc/llvm-project?rev=56618&view=rev
Log:
Emulate gcc driver-driver functionality: run analyzer separately for each separate -arch option.
Modified:
cfe/trunk/utils/ccc-analyzer
Modified: cfe/trunk/utils/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ccc-analyzer?rev=56618&r1=56617&r2=56618&view=diff
==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Thu Sep 25 15:17:57 2008
@@ -246,6 +246,7 @@
# Get the HTML output directory.
my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'};
+my %ArchsSeen;
# Process the arguments.
foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
@@ -255,7 +256,15 @@
if ($Arg eq '-E') { $Action = 'preprocess'; }
elsif ($Arg eq '-c') { $Action = 'compile'; }
elsif ($Arg =~ /^-print-prog-name/) { exit 0; }
-
+
+ # Specially handle duplicate cases of -arch
+ if ($Arg eq "-arch") {
+ my $arch = $ARGV[$i+1];
+ $ArchsSeen{$arch} = 1;
+ ++$i;
+ next;
+ }
+
# Options with possible arguments that should pass through to compiler.
if (defined $CompileOptionMap{$Arg}) {
my $Cnt = $CompileOptionMap{$Arg};
@@ -390,11 +399,23 @@
push @AnalyzeArgs, at CompileOpts;
push @AnalyzeArgs,$file;
- Analyze($Clang, \@AnalyzeArgs, $FileLang, $Output,
- $Verbose, $HtmlDir, $file, $Analyses);
+ my @Archs = keys %ArchsSeen;
+ if (scalar @Archs) {
+ foreach my $arch (@Archs) {
+ my @NewArgs;
+ push @NewArgs, '-arch';
+ push @NewArgs, $arch;
+ push @NewArgs, @AnalyzeArgs;
+ Analyze($Clang, \@NewArgs, $FileLang, $Output,
+ $Verbose, $HtmlDir, $file, $Analyses);
+ }
+ }
+ else {
+ Analyze($Clang, \@AnalyzeArgs, $FileLang, $Output,
+ $Verbose, $HtmlDir, $file, $Analyses);
+ }
}
}
exit($Status >> 8);
-
More information about the cfe-commits
mailing list