summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-24 22:07:12 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-24 22:07:12 +0000
commit9b15effcd1f3a9ea9dec0ba4a4447015196a85b3 (patch)
tree1a7b4aa92a2786cf7f490cbafefe344f8dea425a /clang
parent0be5aa875acb0b869e87743c93eeb27ebcee6019 (diff)
downloadbcm5719-llvm-9b15effcd1f3a9ea9dec0ba4a4447015196a85b3.tar.gz
bcm5719-llvm-9b15effcd1f3a9ea9dec0ba4a4447015196a85b3.zip
ccc-analyzer: Don't analyze files with '-arch ppc' or '-arch ppc64' since Clang
doesn't support Altivec intrisics nor is it likely that we're currently generating all the right #defines, etc., for those architectures. llvm-svn: 65390
Diffstat (limited to 'clang')
-rwxr-xr-xclang/utils/ccc-analyzer12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/utils/ccc-analyzer b/clang/utils/ccc-analyzer
index c58bcfc013f..813c3d91cb7 100755
--- a/clang/utils/ccc-analyzer
+++ b/clang/utils/ccc-analyzer
@@ -333,7 +333,9 @@ if (!defined $Clang) { $Clang = 'clang'; }
# Get the HTML output directory.
my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'};
+my %DisabledArchs = ('ppc' => 1, 'ppc64' => 1);
my %ArchsSeen;
+my $HadArch = 0;
# Process the arguments.
foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
@@ -348,7 +350,10 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
# Specially handle duplicate cases of -arch
if ($Arg eq "-arch") {
my $arch = $ARGV[$i+1];
- $ArchsSeen{$arch} = 1;
+ # We don't want to process 'ppc' because of Clang's lack of support
+ # for Altivec (also some #defines won't likely be defined correctly, etc.)
+ if (!(defined $DisabledArchs{$arch})) { $ArchsSeen{$arch} = 1; }
+ $HadArch = 1;
++$i;
next;
}
@@ -476,6 +481,10 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
}
if ($Action eq 'compile' or $Action eq 'link') {
+ my @Archs = keys %ArchsSeen;
+ # Skip the file if we don't support the architectures specified.
+ exit 0 if ($HadArch && scalar(@Archs) > 0);
+
foreach my $file (@Files) {
# Determine the language for the file.
my $FileLang = $Lang;
@@ -518,7 +527,6 @@ if ($Action eq 'compile' or $Action eq 'link') {
push @AnalyzeArgs,@CompileOpts;
push @AnalyzeArgs,$file;
- my @Archs = keys %ArchsSeen;
if (scalar @Archs) {
foreach my $arch (@Archs) {
my @NewArgs;
OpenPOWER on IntegriCloud