[analyzer] scan-build: Teach ccc-analyzer about -Xclang.

Update ccc-analyzer to forward both -Xclang and its following argument to the
the compiler driver. Previously we were dropping -Xclang and forwarding the
argument on its own if it matched other forwarding criteria. This caused the
argument to be interpreted as a driver rather than a frontend option.

llvm-svn: 251218
This commit is contained in:
Devin Coughlin 2015-10-25 01:30:18 +00:00
parent 7bf52c9d26
commit 26c5df2c21
1 changed files with 9 additions and 0 deletions

View File

@ -667,6 +667,15 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
next;
}
# Handle -Xclang some-arg. Add both arguments to the compiler options.
if ($Arg =~ /^-Xclang$/) {
# FIXME: Check if we are going off the end.
++$i;
push @CompileOpts, $Arg;
push @CompileOpts, $ARGV[$i];
next;
}
if (!($Arg =~ /^-/)) {
push @Files, $Arg;
next;