r251218 - [analyzer] scan-build: Teach ccc-analyzer about -Xclang.
Devin Coughlin via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 24 18:30:18 PDT 2015
Author: dcoughlin
Date: Sat Oct 24 20:30:18 2015
New Revision: 251218
URL: http://llvm.org/viewvc/llvm-project?rev=251218&view=rev
Log:
[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.
Modified:
cfe/trunk/tools/scan-build/ccc-analyzer
Modified: cfe/trunk/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=251218&r1=251217&r2=251218&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/ccc-analyzer Sat Oct 24 20:30:18 2015
@@ -667,6 +667,15 @@ foreach (my $i = 0; $i < scalar(@ARGV);
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;
More information about the cfe-commits
mailing list