The $line that hold arguments is the raw output from Clang with -### option 
passed. An output is consistent: each item in the output is double-quoted, each 
macro definition is split into "-D" and "definition".
In scan-build we call 'quotewords' to extract items. If we call 'quotewords' 
with the false 'keep' parameter we "remove all quotes and backslashes that are 
not themselves backslash-escaped or inside of single quotes" (perldoc 
<http://perldoc.perl.org/Text/ParseWords.html>). Here the problem with paths 
that have spaces arises (at least under Windows).
If we pass true to 'quotewords' 'keep' parameter we preserve all quotes and 
backslashes and this worked for me under Windows, but the regressions were 
reported in comments to r236423 like the following:
clang: error: no such file or directory: '"-cc1"'
clang: error: no such file or directory: '"-analyze"'
...

and regressions caused by extra quotes around macro definitions.
That's how matters stand.
So I came to the following solution: pass true to 'quotewords' to preserve 
arguments unmodified and then strip quotes from every macro definition and from 
all arguments that have no spaces (I've looked through the gcc options manual, 
it looks like macro definitions and paths are the only arguments that can have 
spaces if I am not missing something).


http://reviews.llvm.org/D9357

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to