]> granicus.if.org Git - clang/commitdiff
[analyzer] scan-build: when matching flags, make sure the - is the first letter.
authorJordan Rose <jordan_rose@apple.com>
Wed, 19 Mar 2014 17:42:26 +0000 (17:42 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 19 Mar 2014 17:42:26 +0000 (17:42 +0000)
PR19191

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

tools/scan-build/ccc-analyzer

index e1feae7dac66a89578bf14831af07a66b6ff677b..7f4db96a82db5de250e11bff2f0ecdee19de69fd 100755 (executable)
@@ -150,7 +150,7 @@ sub GetCCArgs {
   close(TO_PARENT);
   my $line;
   while (<FROM_CHILD>) {
-    next if (!/-cc1/);
+    next if (!/\b-cc1\b/);
     $line = $_;
   }
 
@@ -496,7 +496,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
     next;
   }
   # Handle the case where there isn't a space after -iquote
-  if ($Arg =~ /-iquote.*/) {
+  if ($Arg =~ /^-iquote.*/) {
     push @CompileOpts,$Arg;
     next;
   }
@@ -556,7 +556,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
     next;
   }
 
-  if ($Arg =~ /-m.*/) {
+  if ($Arg =~ /^-m.*/) {
     push @CompileOpts,$Arg;
     next;
   }