[PATCH][Review request] Add PrintingPolicy option to suppress implicit casts for pretty printing

Jordan Rose jordan_rose at apple.com
Mon May 6 10:37:45 PDT 2013


On May 4, 2013, at 19:26 , Dmitri Gribenko <gribozavr at gmail.com> wrote:

> On Fri, May 3, 2013 at 8:07 PM, Joe Sprowes <sprowes at silkan.com> wrote:
>> This patch allows suppression of implicit cast when pretty printing the AST.
>> For example:
>> 
>> i = a.operator int();
> 
> I'd prefer not to add yet another flag to the printing policy.
> Unfortunately, skipping printing conversion operators changes CFG dump
> output, which I am not familiar with.
> 
> Jordan, could you please take a look at the attached patch?

Yeah, thanks for the heads-up. Joe, we'd really prefer to have the CFG dump not skip any implicit statements, since it is a dump for debugging purposes. We are stretching the pretty-printer quite a bit for this, though.

This does keep coming up, so having a NeverSkipSubExpressions flag (or in the positive form MaySkipSubExpressions or SkipImplicitSubExpressions) just for the CFG dump would work fine. I don't have time to do this immediately, but it should be a pretty small amount of work, and would keep down future conflicts between CFG dumping and real pretty-printing.

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130506/f1fa0c1a/attachment.html>


More information about the cfe-commits mailing list