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 15:03:33 -0700
- Subject: Re: Ada, treelang needs to be converted to --enable-mapped-location
- References: <10410062111.AA17202@vlsi1.ultra.nyu.edu>
Richard Kenner wrote:
As Zack and have I've patiently tried to explain: line-map.[ch] is not
part of or dependent on GCC or its back-end.
No, but it's part of the GCC tree. Which means that it's inappropriate to
include it in files that have nothing to do with the GCC tree (e.g., GNAT
targeted for the AAMP).
So? gcc/ada is part of the GCC tree. How is line-map.[ch] different?
To give you an idea of the complexity, this is the data structure that
the Ada front end uses to store information about each file.
> ...
> type Source_File_Record is record
> ...
I'm not suggesting changing any of this.
*Just* the implementation of the Source_Ptr type.
Yes, there is a slight duplication in that (I assume) you need to map
from a Source_Ptr to a Source_File_Record. I've thought about adding
an extra "client" hook into each line_map entry. Ada could use this to
inexpensively map a source_location to a Source_Ptr. It would also be
useful for the compile-server, which could use it to map source_location
to "fragments".
Your approach is to keep the Ada front-end as self-contained and "pure
Ada" as possible. That may be in conflict with what to us are more
important goals: consistency between languages in things like option
handling, and diagnostic handling. These things are important to
higher-level tools, such as IDEs.
The best way of handling such consistency is defining a specification for
the error messages and having each language be consistent with that
specification.
Even better is for each language to use the same library.
But that's not an issue we need to deal with now.
--
--Per Bothner
per@bothner.com http://per.bothner.com/