This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Language-independent functions-as-trees representation
On Fri, 23 Aug 2002 21:01:22 +0100, Neil Booth <neil@daikokuya.co.uk> wrote:
> Jason Merrill wrote:-
>
>> It's still not clear to me how best to represent line number information.
>> I'd appreciate someone from the Java team explaining to me how it's handled
>> there, particularly the use of EXPR_WFL_LINECOL on
>> non-EXPR_WITH_FILE_LOCATION nodes.
>
> I think this new IR is an *excellent* opportunity to get this right.
> Namely, a location is uniquely specified by a (line, col) pair; there is
> no need for a filename. See cpplib and line-map.h. There's no reason
> all of GCC can't do this.
Makes sense. I'm also interested in what dewar was saying about having
logical line numbers for instantiations; that sort of thing seems necessary
if we are going to carry template instantiation context information into
the tree IR.
I currently have no opinion about whether to express line and column
numbers separately or use a lookup table.
Does anyone object to using TREE_COMPLEXITY for source position in all
expressions (i.e. things which have TREE_COMPLEXITY, not *_DECL, *_CST)?
None of the frontends currently in the tree seem to use it for anything
that makes it into the backend.
Jason