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]

Re: Proposed new tree node for gcc


Alexandre Petit-Bianco <apbianco@cygnus.com> wrote:
> We (Per Bothner and myself) propose the definition of a new tree node
> called EXPR_WITH_FILE_LOCATION defined as a 'e' node.

That should be a '1' node.

There should also be a macro like:

#define EXPR_WFL_SET_LINE_COLUMN(NODE, LINE, COL) \
  (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff))

Richard Henderson <rth@cygnus.com> wrote:

> While I think that the idea is good, doing such gross things with
> overloading `common.chain' is very bad.  Defining a new struct is
> not so difficult, and should be the way this is accomplished.

While I am not religious on the subject, I do think it is
desirable to not waste space.  (I know - this is a goal that
is foreign to gcc ...)  If we are going to represent entire
programs (including imported files) as tree nodes, there may be
a lot of EXPR_WITH_FILE_LOCATION nodes.  Wasting a word for each
seems a shame.

There is already precdent for overloading common.chain in TYPE_STUB_DECL,
so it is too late to argue that common.chain should only be used to link
things together into a list.

Note that you could not use TREE_CHAIN to chain arbitrary expressions
together, since declarations are expressions, but the TREE_CHAIN of a
declaration is usually in use.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner


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