]> granicus.if.org Git - clang/commitdiff
[analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.
authorJordan Rose <jordan_rose@apple.com>
Tue, 22 Oct 2013 18:55:18 +0000 (18:55 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 22 Oct 2013 18:55:18 +0000 (18:55 +0000)
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193184 91177308-0d34-0410-b5e6-96231b3b80d8

tools/scan-build/ccc-analyzer

index 5f6314882ba5d8728c10f0e47415c3451306adc7..b463ec041e666533262deb7227b2292b6b44f24a 100755 (executable)
@@ -484,10 +484,6 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
     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); ++$i) {
     next;
   }
   
+  if ($Arg =~ /-m.*/) {
+    push @CompileOpts,$Arg;
+    next;
+  }
+  
   # Language.
   if ($Arg eq '-x') {
     $Lang = $ARGV[$i+1];