This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Trying to make list nodes smaller, but the C++ FE keepsbeating me down
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Mike Stump <mrs at apple dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 15 May 2005 14:44:32 -0400 (EDT)
- Subject: Re: [PATCH]: Trying to make list nodes smaller, but the C++ FE keepsbeating me down
- References: <F9F39964-C56D-11D9-B874-003065BDF310@apple.com>
On Sun, 15 May 2005, Mike Stump wrote:
On Saturday, May 14, 2005, at 08:41 PM, Daniel Berlin wrote:
It removes the TREE_TYPE field from TREE_LIST,
This is just hard. Better to not use TREE_LIST, which is a TREE, which is
defined to have a type,
Stop here.
We have other trees that don't have types :)
STATEMENT_LIST, etc.
We should be able to get rid of all of them without making htem
"not-trees".
and instead retype it to be a LIST, and then fixup
all the code so that it uses the hard type instead. After converting all the
code, I suspect TREE_LIST could just go away entirely.
We can't easily, because it's in CALL_EXPR, and a *lot* of places expect
all operands of a call expr to be a tree, including the list.
Sad, but true. This would be very hard to change, because we have
recursive calls that call themselves on TREE_OPERAND (CALL_EXPR, 1) and
take a tree as a parameter.
If we can't do TREE_LIST, i'm thinking of making a
struct tree_minimal that is the base for "struct tree_common", and only
contains the "chain" field (IE no type or flags).
Then STATEMENT_LIST and friends could use struct tree_minimal.
We could also have an ARGUMENT_LIST that is tree_minimal and only consists
of TREE_VALUE, not TREE_PURPOSE.
The second of these will require about half the work of making
TREE_OPERAND (CALL_EXPR, 1) not a tree :).
IE
struct tree_argument_list
{
struct tree_minimal minimal;
tree value;
};