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: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: per at bothner dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 2 Oct 04 16:53:40 EDT
- Subject: Re: Ada, treelang needs to be converted to --enable-mapped-location
To summarize: you can create the Source_Ptr -> source_location
mapping in two basic ways: interleaved with lexing, or as a
mapping when the Source_Buffer is read in. Whichever you prefer.
I guess the question is what does "read" mean in the context of a
compiler that doesn't call the lexer library.
It's tricky to make calls from the Ada part of the code since, as Geert
pointed out, that code is also used wiht non-GCC back-ends.
Moreover, it's quite common for the Ada front-end to read a file and
no item in the file is in the produced tree.
So I'd interpret "read" as meaning "being asked to convert the first
GNAT tree node using this file into a GCC node". Is there a way to find
out if a filename has been seen already or do we need a separate hash table
just for that purpose?