This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ada, treelang needs to be converted to --enable-mapped-location


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]