[cfe-dev] Clang macro expansion differs from GCC

David Peixotto dmp at rice.edu
Mon Apr 12 21:44:26 PDT 2010


Hi Chris,

Here is an updated patch that applied cleanly to the trunk. I can see that it is quite a moving target so hopefully it is still valid by the time you get it :) I also fixed the formatting of the & token to be consistent with the rest of the code. Please let me know if you see any more issues. Thanks!

-Dave



On Apr 12, 2010, at 7:12 PM, Chris Lattner wrote:

> 
> On Apr 11, 2010, at 11:43 AM, David Peixotto wrote:
> 
>> Hi Chris,
>> 
>> I took a look at modifying the preprocessor output and it was pretty
>> straightforward. I have attached a patch that makes the preprocessed output
>> less conservative in adding spaces between periods. It will now add a space to
>> avoid turning ".. ." into "...", but does not always add a space between two
>> consecutive dots.
>> 
>> The change was done by keeping track of the last two tokens that were output
>> and testing against those two tokens to avoid creating "...". Previously only
>> the last output token was tracked and tested against, which caused any two
>> consecutive . tokens to have a space between them.
>> 
>> The patch passes all the tests in the tests subdirectory. I modified one test
>> to reflect the output changing from ". . ." to ".. .". This output happens to
>> match the expected output in the test comment. I also added a test for the
>> original case that was causing me problems.
>> 
>> Please let me know if there are more tests I should run or anything else that
>> needs to happen for the patch to be accepted. Thanks!
> 
> This patch looks great, except that it happens to conflict on mainline.  :(  Please send and updated patch and I'll be happy to apply it for you.  One minor thing is to watch & placement in "const Token& PrevPrevTok, "
> 
> Thanks for working on this!
> 
> -Chris
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100412/ce35f959/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PPdots2.patch
Type: application/octet-stream
Size: 4829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100412/ce35f959/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100412/ce35f959/attachment-0001.html>


More information about the cfe-dev mailing list