r193184 - [analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.

Jordan Rose jordan_rose at apple.com
Tue Oct 22 11:55:18 PDT 2013


Author: jrose
Date: Tue Oct 22 13:55:18 2013
New Revision: 193184

URL: http://llvm.org/viewvc/llvm-project?rev=193184&view=rev
Log:
[analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.

Some of the shared compiler/linker flags start with -m, so they've been
getting passed to the compiler only since r180073. Now, the -m* wildcard
is processed after the shared flags and the ignored flags.

Found by Laszlo Nagy!

Modified:
    cfe/trunk/tools/scan-build/ccc-analyzer

Modified: cfe/trunk/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=193184&r1=193183&r2=193184&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/ccc-analyzer Tue Oct 22 13:55:18 2013
@@ -484,10 +484,6 @@ foreach (my $i = 0; $i < scalar(@ARGV);
     while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; }
     next;
   }
-  if ($Arg =~ /-m.*/) {
-    push @CompileOpts,$Arg;
-    next;
-  }
   # Handle the case where there isn't a space after -iquote
   if ($Arg =~ /-iquote.*/) {
     push @CompileOpts,$Arg;
@@ -549,6 +545,11 @@ foreach (my $i = 0; $i < scalar(@ARGV);
     next;
   }
   
+  if ($Arg =~ /-m.*/) {
+    push @CompileOpts,$Arg;
+    next;
+  }
+  
   # Language.
   if ($Arg eq '-x') {
     $Lang = $ARGV[$i+1];





More information about the cfe-commits mailing list