[PATCH PING] c++-specific bits of tree-slimming patches
Richard Guenther
rguenther@suse.de
Thu Apr 14 11:32:00 GMT 2011
On Thu, 14 Apr 2011, Nathan Froyd wrote:
> On Fri, Apr 08, 2011 at 01:50:24PM -0400, Jason Merrill wrote:
> > On 03/24/2011 09:15 AM, Nathan Froyd wrote:
> >> + tree t = make_node (CASE_LABEL_EXPR);
> >> +
> >> + TREE_TYPE (t) = void_type_node;
> >> + SET_EXPR_LOCATION (t, input_location);
> >
> > As jsm and richi said, using input_location like this is a regression.
> > Can we use DECL_SOURCE_LOCATION (label_decl) instead?
>
> Sure. Joseph, Richi, are you happy with that change? It would fix the
> C/C++ regression, as c_add_case_label does:
>
> /* Create the LABEL_DECL itself. */
> label = create_artificial_label (loc);
> ...
> /* Add a CASE_LABEL to the statement-tree. */
> case_label = add_stmt (build_case_label (loc, low_value, high_value, label));
>
> so the DECL_SOURCE_LOCATION would be the same as the location_t we were
> passing in anyway. For the other languages, I think it would be neutral
> or an improvement (they all use input_location or UNKNOWN_LOCATION for
> the CASE_LABEL anyway).
Yes, using DECL_SOURCE_LOCATION (label_decl) sounds like the correct
thing.
Richard.
More information about the Gcc-patches
mailing list