From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Merrill To: Neil Booth Cc: gcc@gcc.gnu.org Subject: Re: Language-independent functions-as-trees representation Date: Wed, 28 Aug 2002 04:44:00 -0000 Message-id: References: <20020823200122.GF7880@daikokuya.co.uk> X-SW-Source: 2002-08/msg01826.html On Fri, 23 Aug 2002 21:01:22 +0100, Neil Booth 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