[cfe-commits] Patches for clang -ast-print

Jordan Rose jordan_rose at apple.com
Mon Oct 29 17:00:57 PDT 2012


On Oct 29, 2012, at 13:25 , Eli Friedman <eli.friedman at gmail.com> wrote:

> On Sun, Oct 28, 2012 at 1:52 PM, Grzegorz Jablonski <grzejabl at gmail.com> wrote:
>> On 10/28/2012 09:04 PM, Eli Friedman wrote:
>>> 
>>> On Sun, Oct 28, 2012 at 3:41 AM, Grzegorz Jablonski <grzejabl at gmail.com>
>>> wrote:
>>>> 
>>>> On 10/28/2012 03:45 AM, Eli Friedman wrote:
>>>>> 
>>>>> We shouldn't be printing "operator const char*" in the first place.
>>>> 
>>>> OK, revised patch.
>>> 
>>> Please use CastExpr::getSubExprAsWritten.
>>> 
>> Like that?
> 
> (Adding cfe-commits to the CC list.)
> 
> It's a bit scary that this affects CFG dumping. Can someone who knows
> that code take a look?

Yeah, this is definitely not desireable, even if it is just a debugging feature. PrinterHelpers allow us to do something special when printing a certain expression, and the helper might want to see one ImplicitCastExpr inside another.

I'm not sure what the correct answer is now. Maybe the CFG printer is using the wrong PrintingPolicy anyway, but just skipping over implicit nodes seems scary.

Jordan



More information about the cfe-commits mailing list