[PATCH] [analyzer] Support spaces in compiler path and arguments.
Антон Ярцев
anton.yartsev at gmail.com
Wed May 6 16:54:07 PDT 2015
The patch, committed as r236423 caused at least two types of regressions:
1. (not reproduced on Windows) :
clang: error: no such file or directory: '"-cc1"'
clang: error: no such file or directory: '"-triple"'
...
2. Macro definitions with quotes were corrupted ( e.g. -DVAL_CONFIGURE="\"'CFLAGS=-fno-vectorize' 'CC=ccc-analyzer'\"" )
In the updated patch I restricted wrapping an argument with quotes to cases when an argument has spaces and arguments first symbol is not a quotation mark.
Ok to commit?
http://reviews.llvm.org/D9357
Files:
tools/scan-build/ccc-analyzer
Index: tools/scan-build/ccc-analyzer
===================================================================
--- tools/scan-build/ccc-analyzer
+++ tools/scan-build/ccc-analyzer
@@ -145,7 +145,7 @@
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);
}
@@ -180,6 +180,9 @@
# Strip leading and trailing whitespace characters.
$line =~ s/^\s+|\s+$//g;
my @items = quotewords('\s+', 0, $line);
+ foreach (@items) {
+ $_ = qq/"$_"/ if (/^[^"'].*?\s+/os);
+ }
my $cmd = shift @items;
die "cannot find 'clang' in 'clang' command\n" if (!($cmd =~ /clang/));
return \@items;
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9357.25105.patch
Type: text/x-patch
Size: 773 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150506/c791c9e4/attachment.bin>
More information about the cfe-commits
mailing list