converting Ada to handle USE_MAPPED_LOCATION

Geert Bosch bosch@adacore.com
Sun Mar 20 02:52:00 GMT 2005


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



More information about the Gcc mailing list