On Mon, Sep 14, 2020 at 09:30:44PM -0400, Marek Polacek via Gcc-patches wrote:
> --- a/gcc/c/c-tree.h
> +++ b/gcc/c/c-tree.h
> @@ -147,6 +147,11 @@ struct c_expr
>       etc), so we stash a copy here.  */
>    source_range src_range;
>  
> +  /* True iff the sizeof expression was enclosed in parentheses.
> +     NB: This member is currently only initialized when .original_code
> +     is a SIZEOF_EXPR.  ??? Add a default constructor to this class.  */
> +  bool parenthesized_p;
> +
>    /* Access to the first and last locations within the source spelling
>       of this expression.  */
>    location_t get_start () const { return src_range.m_start; }

I think a magic tree code would be better, c_expr is used in too many places
and returned by many functions, so it is copied over and over.
Even if you must add it, it would be better to change the struct layout,
because right now there are fields: tree, location_t, tree, 2xlocation_t,
which means 32-bit gap on 64-bit hosts before the second tree, so the new
field would fit in there.  But, if it is mostly uninitialized, it is kind of
unclean.

        Jakub

Reply via email to