[C PATCH, committed] Use protected_set_expr_location more
Marek Polacek
polacek@redhat.com
Wed Oct 7 11:02:00 GMT 2015
On Wed, Oct 07, 2015 at 10:14:54AM +0200, Richard Biener wrote:
> > --- gcc/c/c-parser.c
> > +++ gcc/c/c-parser.c
> > @@ -5141,9 +5141,8 @@ c_parser_statement_after_labels (c_parser *parser, vec<tree> *chain)
> > (recursively) all of the component statements should already have
> > line numbers assigned. ??? Can we discard no-op statements
> > earlier? */
> > - if (CAN_HAVE_LOCATION_P (stmt)
> > - && EXPR_LOCATION (stmt) == UNKNOWN_LOCATION)
> > - SET_EXPR_LOCATION (stmt, loc);
> > + if (EXPR_LOCATION (stmt) == UNKNOWN_LOCATION)
> > + protected_set_expr_location (stmt, loc);
>
> This one doesn't look like an improvement though as EXPR_LOCATION tests
> CAN_HAVE_LOCATION_P and returns UNKNOWN_LOCATION if not.
Yeah, but protected_set_expr_location tests CAN_HAVE_LOCATION_P so we
wouldn't set the location anyway.
But I can surely revert that bit if you prefer.
Marek
More information about the Gcc-patches
mailing list