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

Ted Kremenek kremenek at apple.com
Mon Sep 29 09:15:20 PDT 2008


Author: kremenek
Date: Mon Sep 29 11:15:20 2008
New Revision: 56790

URL: http://llvm.org/viewvc/llvm-project?rev=56790&view=rev
Log:
Discard extra -isysroot options.  This fixes:
<rdar://problem/6253141> Parser rejection occurs when command line has more than one -isysroot switch

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=56790&r1=56789&r2=56790&view=diff

==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Mon Sep 29 11:15:20 2008
@@ -215,6 +215,10 @@
   'mi'  => 'objective-c-cpp-output'
 );
 
+my %UniqueOptions = (
+  '-isysroot' => 0  
+);
+
 ##----------------------------------------------------------------------------##
 #  Main Logic.
 ##----------------------------------------------------------------------------##
@@ -225,6 +229,7 @@
 my @Files;
 my $Lang;
 my $Output;
+my %Uniqued;
 
 # Forward arguments to gcc.
 my $Status = system($CC, at ARGV);
@@ -287,6 +292,17 @@
     my $Cnt = $CompilerLinkerOptionMap{$Arg};
     push @CompileOpts,$Arg;    
     push @LinkOpts,$Arg;
+
+    # Check if this is an option that should have a unique value, and if so
+    # determine if the value was checked before.
+    if ($UniqueOptions{$Arg}) {
+      if (defined $Uniqued{$Arg}) {
+        $i += $Cnt;
+        next;
+      }
+      $Uniqued{$Arg} = 1;
+    }
+    
     while ($Cnt > 0) {
       ++$i; --$Cnt;
       push @CompileOpts, $ARGV[$i];





More information about the cfe-commits mailing list