[RFA] Use location_t to record declaration location in tree_decl

Neil Booth neil@daikokuya.co.uk
Tue Jun 25 10:52:00 GMT 2002


Gabriel Dos Reis wrote:-

> Richard Henderson <rth@redhat.com> writes:
> 
> | Wasn't there an idea of using a linearized line number in cpplib?
> 
> Yes, there was a discussion about that.  But it turns out that we were
> actually considering two kinds of location:
> 
>   1) location of definition -- which is addressed by my patch, and
>      traditionally that is what has been in tree_decl, my patch is
>      just proposing to pack that information into a single structure.
> 
>   2) location of use, most often attached to token and is mostly what
>      Neil was talking about with line-map stuff (if I understood him
>      correctly).  That information is mostly ephemeral in the whole
>      process of translation.

You should be able to use a "linearized line" for both I think
(eventually, at least).

>    location_t saved_locus;
>    saved_locus = current_input_locus;
>    current_input_locus = DECL_SOURCE_LOCATION (decl);
>    /* ... */
>    current_input_locus = saved_locus;   

Can I suggest "loc" instead of "locus"?  My mathematician's
understanding of "locus" is a set of points, in particular a path.

Neil.



More information about the Gcc-patches mailing list