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:

    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/


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