This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Shrinking INTEGER_CSTs and IDENTIFIER_NODEs
- To: zack at wolery dot cumb dot org
- Subject: Re: Shrinking INTEGER_CSTs and IDENTIFIER_NODEs
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 27 Aug 2000 21:31:41 -0700
- Cc: gcc at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <20000827192157.S17776@wolery.cumb.org>
>>>>> "Zack" == Zack Weinberg <zack@wolery.cumb.org> writes:
Zack> Ideas?
You really are going down all the funny paths I've explored. That's
good -- perhaps you'll follow through somewhere where I did not.
The thing you've spotted is an instance of a more generic problem.
For example lots of DECLs don't use all the fields in a DECL. We have
DECL_LANG_SPECIFIC, but we don't have different structures for
VAR_DECLs vs. FUNCTION_DECLs vs. NAMESPACE_DECLs vs ...
It would be good if trees allowed for these variants. It would also
make the code a lot cleaner; we wouldn't have all those fields that
are used three different ways depending which macro you come in
through.
--
Back to your question... In C++, we should get rid of most the entra
stuff in lang_identifier. In particular, class_template_info and
class_value should probably go. namespace_bindings and just plain
bindings could probably be combined into a single bindings TREE_LIST,
or something. One of the reasons is that for every global, we have an
IDENTIFIER_NODE for the mangled name; but mangled names don't use any
of the extra fields. So the extra fields are just wasted space. (In
fact, all we really need for the mangled name is a string; all of
tree_common is wasted.)
One alternate design is to just store the strings directly in
DECL_NAME/DECL_ASSEMBLER_NAME and use IDENTIFIER_NODEs only in the
symbol table. As you exit a scope, throw away the symbol table,
keeping only the strings. Right now, IDENTIFIER_NODE is used both to
implement the symbol table (via the TREE_TYPE, namespace_bindings,
TREE_CHAIN, etc.) and as the thing to which DECL_NAME and
DECL_ASSEMBLER_NAME point.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com