This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: converting Ada to handle USE_MAPPED_LOCATION
- From: Geert Bosch <bosch at adacore dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 19 Mar 2005 19:52:36 -0500
- Subject: Re: converting Ada to handle USE_MAPPED_LOCATION
- References: <423C82E8.4050304@bothner.com>
Hi Per,
Of the three proposals:
[...]
The ideal solution I think is for Ada to use line-map's
source_location for Sloc in its lexer.
[...]
translate Sloc integers to source_location
when we translate the Ada intermal format to Gcc trees.
[...]
the location_t in the shared Gcc should be a language-defined opaque
time,
and have language call-backs.
The first one really is out for the Ada maintainers, as this would
couple
the front end far too tightly to the back end and lose the nice
property that
the exact same front end sources (excluding the few C files for tree
conversion)
can be used for any GCC back end from 2.8.1 to 4.1 without
modifications, as
well as non-GCC back ends.
The second one wouldn't be my preferred choice, as it adds complexity
for no
gain, but because the code can remain localized to the few C files
interfacing
the front end to the back end, this would be acceptable.
The last would be far preferred, as it would not tie in front ends so
much to the back
end, while still allowing sharing of the line map implementation when
desired. As it both
seems easiest to implement, and cleanest. Clean separation from the
back end is important
for languages maintained outside the GCC tree.
-Geert