[cfe-commits] r65390 - /cfe/trunk/utils/ccc-analyzer

Ted Kremenek kremenek at apple.com
Tue Feb 24 14:07:12 PST 2009


Author: kremenek
Date: Tue Feb 24 16:07:12 2009
New Revision: 65390

URL: http://llvm.org/viewvc/llvm-project?rev=65390&view=rev
Log:
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.

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=65390&r1=65389&r2=65390&view=diff

==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Tue Feb 24 16:07:12 2009
@@ -333,7 +333,9 @@
 # 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 @@
   # 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 @@
 }
 
 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 @@
     push @AnalyzeArgs, at CompileOpts;
     push @AnalyzeArgs,$file;
 
-    my @Archs = keys %ArchsSeen;
     if (scalar @Archs) {
       foreach my $arch (@Archs) {
         my @NewArgs;





More information about the cfe-commits mailing list