This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada, treelang needs to be converted to --enable-mapped-location
- From: Per Bothner <per at bothner dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 06 Oct 2004 17:44:49 -0700
- Subject: Re: Ada, treelang needs to be converted to --enable-mapped-location
- References: <10410062329.AA18666@vlsi1.ultra.nyu.edu>
Richard Kenner wrote:
> In another thread I proposed a very simple solution. Can you please
> comment on whether it's workable or not?
No. What I'm talking about is the proposal to use Ada's Sloc as the
source_location and make a language hook that calls expand_location by
default but for Ada, calls a function that's essentially Sloc_to_locus
and expands out the Sloc into (file, line, column). That way there's
exactly one representation of source location in use and one file name
table.
It can certainly be made to work. I am not in favor of this change,
though, as it requires adding call-back hooks, which are generally to
be avoided, and which in this case are unnecessary, even if they make
it easier in the short term.
However, if you can persuade Zack or some other global write
maintainer I won't put up much of a fight. I do think the
linemap_find_location api extension I suggested is a better
solution: it's a modest localized change for Ada, and doesn't
effect the rest of the compiler. There is a slight performance
penalty, but I doubt it would be measurable, and it would be
partly compensate by reduced call-back indirection.
The ideal solution is to change Source_Ptr to be the same as
source_location. We're certainly open to moidfying the latter
if needed, assuming there is no measurable performance degradation.
--
--Per Bothner
per@bothner.com http://per.bothner.com/