From 69ab7267244b2a9bcd61b001bd1b5be8953a702d Mon Sep 17 00:00:00 2001 From: Jordan Rose <jordan_rose@apple.com> Date: Wed, 19 Mar 2014 17:42:26 +0000 Subject: [PATCH] [analyzer] scan-build: when matching flags, make sure the - is the first letter. PR19191 llvm-svn: 204253 --- clang/tools/scan-build/ccc-analyzer | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/tools/scan-build/ccc-analyzer b/clang/tools/scan-build/ccc-analyzer index e1feae7dac66..7f4db96a82db 100755 --- a/clang/tools/scan-build/ccc-analyzer +++ b/clang/tools/scan-build/ccc-analyzer @@ -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; }