[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)

llvm-svn: 236423
This commit is contained in:
Anton Yartsev 2015-05-04 13:37:36 +00:00
parent 20f0b01a92
commit c312ef1d17
1 changed files with 2 additions and 2 deletions

View File

@ -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;