Add "argument key" processing similar to ccc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57780 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer
index d99c7c7..4c47c09 100755
--- a/utils/ccc-analyzer
+++ b/utils/ccc-analyzer
@@ -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;
     }