On 4/21/21 1:26 PM, Martin Liška wrote:
> On 4/21/21 12:56 PM, Jakub Jelinek wrote:
>> On Wed, Apr 21, 2021 at 12:52:42PM +0200, Martin Liška wrote:
>>> On 4/21/21 11:04 AM, Jakub Jelinek wrote:
>>>> Wouldn't it be better to be consistent with tree-pretty-print.c on this
>>>> or perhaps just call dump_generic_node or whatever is used to dump
>>>> those e.g. for C?
>>>
>>> Yes, I'm going to install patch that does:
>>>
>>> +      if (DECL_NAME (t))
>>>
>>> +       pp_cxx_tree_identifier (pp, DECL_NAME (t));
>>>
>>> +      else
>>>
>>> +       dump_generic_node (pp, t, 0, TDF_SLIM, false);
>>
>> Wouldn't flags | TDF_SLIM be better, so that it honors nouid etc.?
>>
>>      Jakub
>>
> 
> Good point, fixed that.

Oh, it leads to:

/home/marxin/Programming/gcc/gcc/cp/error.c: In function ‘void 
dump_decl(cxx_pretty_printer*, tree, int)’:

/home/marxin/Programming/gcc/gcc/cp/error.c:1368:37: error: invalid conversion 
from ‘int’ to ‘dump_flags_t’ {aka ‘dump_flag’} [-fpermissive]

 1368 |  dump_generic_node (pp, t, 0, flags | TDF_SLIM, false);

      |                               ~~~~~~^~~~~~~~~~

      |                                     |

      |                                     int


Thus I reverted the change. It uses flags defined in cp/cp-tree.h:
#define TFF_PLAIN_IDENTIFIER                    (0)
#define TFF_SCOPE                               (1)
#define TFF_CHASE_TYPEDEF                       (1 << 1)
#define TFF_DECL_SPECIFIERS                     (1 << 2)
...

Martin

> 
> Thanks,
> Martin
> 

Reply via email to