Author: ayartsev Date: Mon May 4 08:37:36 2015 New Revision: 236423 URL: http://llvm.org/viewvc/llvm-project?rev=236423&view=rev Log: [analyzer] scan-build: support spaces in compiler path and arguments.
This fixes errors that occur if a path to the default compiler has spaces or if an argument with spaces is given to compiler (e.g. via -I). (http://reviews.llvm.org/D9357) 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=236423&r1=236422&r2=236423&view=diff ============================================================================== --- cfe/trunk/tools/scan-build/ccc-analyzer (original) +++ cfe/trunk/tools/scan-build/ccc-analyzer Mon May 4 08:37:36 2015 @@ -145,7 +145,7 @@ sub ProcessClangFailure { print OUT "@$Args\n"; close OUT; `uname -a >> $PPFile.info.txt 2>&1`; - `$Compiler -v >> $PPFile.info.txt 2>&1`; + `"$Compiler" -v >> $PPFile.info.txt 2>&1`; rename($ofile, "$PPFile.stderr.txt"); return (basename $PPFile); } @@ -179,7 +179,7 @@ sub GetCCArgs { die "could not find clang line\n" if (!defined $line); # Strip leading and trailing whitespace characters. $line =~ s/^\s+|\s+$//g; - my @items = quotewords('\s+', 0, $line); + my @items = quotewords('\s+', 1, $line); my $cmd = shift @items; die "cannot find 'clang' in 'clang' command\n" if (!($cmd =~ /clang/)); return \@items; _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
