From: Devin Coughlin Date: Sun, 25 Oct 2015 01:30:18 +0000 (+0000) Subject: [analyzer] scan-build: Teach ccc-analyzer about -Xclang. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1315efcc022d15c95c9d432dce46488b7dfa5ceb;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251218 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer index 5ea1fad9bc..8bbb1037e6 100755 --- a/tools/scan-build/ccc-analyzer +++ b/tools/scan-build/ccc-analyzer @@ -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;