[cfe-dev] prettyprint statement

Douglas Gregor dgregor at apple.com
Wed Dec 26 10:09:27 PST 2012


On Dec 25, 2012, at 5:40 PM, Mohammad Adil <madil90 at gmail.com> wrote:

> Hi,
>    I believe that the problem comes when the stmtprinter handles expressions. All statements which are not expressions are printed fine while statements which are also expressions (a = 1;) do not have a semicolon(;) at the end.

Right. You'll likely need to add some context to the pretty printer so that it will add the ; to expressions in a statement context. 

> Please tell me the procedure to submit a patch fix? I will be very happy to contribute.

There is some documentation here:

http://llvm.org/docs/DeveloperPolicy.html#making-a-patch

Clang patches should go to cfe-commits. Thanks!

  - Doug

> Regards,
> Adil
> 
> 
> On Wed, Dec 26, 2012 at 3:18 AM, Douglas Gregor <dgregor at apple.com> wrote:
>> 
>> 
>> Sent from my iPhone
>> 
>> On Dec 25, 2012, at 1:57 PM, madil90 <madil90 at gmail.com> wrote:
>> 
>> > Hi,
>> >   When using prettyPrint (or Rewriter::ConverToString()) to print a
>> > statement, clang prints some statements with ";" and some without it. The
>> > statement "int a,b;" is printed as it is while the statement "a--;" is
>> > printed as "a--" omitting the ";" at the end. How can I tell which
>> > statements retain ";" and which statements omit it. Is there any special
>> > reason for not including ";" in some statements?
>> 
>> I consider this a bug. All statements that need a semicolon should print one. Can I interest you in submitting a patch to fix this?
>> 
>>   - Doug
>> 
>> > Regards,
>> > Adil
>> >
>> >
>> >
>> > --
>> > View this message in context: http://clang-developers.42468.n3.nabble.com/prettyprint-statement-tp4029182.html
>> > Sent from the Clang Developers mailing list archive at Nabble.com.
>> > _______________________________________________
>> > cfe-dev mailing list
>> > cfe-dev at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 
> 
> 
> -- 
> Mohammad Adil
> LUMS SSE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121226/5de7d33c/attachment.html>


More information about the cfe-dev mailing list