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

Ted Kremenek kremenek at apple.com
Sat Oct 18 23:42:39 PDT 2008


Author: kremenek
Date: Sun Oct 19 01:42:38 2008
New Revision: 57780

URL: http://llvm.org/viewvc/llvm-project?rev=57780&view=rev
Log:
Add "argument key" processing similar to ccc.

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=57780&r1=57779&r2=57780&view=diff

==============================================================================
--- cfe/trunk/utils/ccc-analyzer (original)
+++ cfe/trunk/utils/ccc-analyzer Sun Oct 19 01:42:38 2008
@@ -257,8 +257,9 @@
 
 # Process the arguments.
 foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
-  my $Arg = $ARGV[$i];
-  
+  my $Arg = $ARGV[$i];  
+  my ($ArgKey) = split /=/,$Arg,2;
+
   # Modes ccc-analyzer supports
   if ($Arg eq '-E') { $Action = 'preprocess'; }
   elsif ($Arg eq '-c') { $Action = 'compile'; }
@@ -273,16 +274,16 @@
   }
 
   # Options with possible arguments that should pass through to compiler.
-  if (defined $CompileOptionMap{$Arg}) {
-    my $Cnt = $CompileOptionMap{$Arg};
+  if (defined $CompileOptionMap{$ArgKey}) {
+    my $Cnt = $CompileOptionMap{$ArgKey};
     push @CompileOpts,$Arg;
     while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; }
     next;
   }
 
   # Options with possible arguments that should pass through to linker.
-  if (defined $LinkerOptionMap{$Arg}) {
-    my $Cnt = $LinkerOptionMap{$Arg};
+  if (defined $LinkerOptionMap{$ArgKey}) {
+    my $Cnt = $LinkerOptionMap{$ArgKey};
     push @LinkOpts,$Arg;
     while ($Cnt > 0) { ++$i; --$Cnt; push @LinkOpts, $ARGV[$i]; }
     next;
@@ -290,8 +291,8 @@
 
   # Options with possible arguments that should pass through to both compiler
   # and the linker.
-  if (defined $CompilerLinkerOptionMap{$Arg}) {
-    my $Cnt = $CompilerLinkerOptionMap{$Arg};
+  if (defined $CompilerLinkerOptionMap{$ArgKey}) {
+    my $Cnt = $CompilerLinkerOptionMap{$ArgKey};
     
     # Check if this is an option that should have a unique value, and if so
     # determine if the value was checked before.
@@ -315,8 +316,8 @@
   }
   
   # Ignored options.
-  if (defined $IgnoredOptionMap{$Arg}) {
-    my $Cnt = $IgnoredOptionMap{$Arg};
+  if (defined $IgnoredOptionMap{$ArgKey}) {
+    my $Cnt = $IgnoredOptionMap{$ArgKey};
     while ($Cnt > 0) {
       ++$i; --$Cnt;
     }





More information about the cfe-commits mailing list