This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: namespaces -- time to do something?
- To: egcs at cygnus dot com
- Subject: Re: namespaces -- time to do something?
- From: Per Bothner <bothner at cygnus dot com>
- Date: Wed, 10 Dec 1997 19:09:45 -0800
- Reply-To: egcs at cygnus dot com
> Two "value fields" per id: unqualified and qualified. Both are lists.
I suggest not using TREE_LIST nodes, though. Instead add a
lang_specific DECL_SHADOWS field, and use that to chain the
actual decl nodes. That makes it easy to find which decl
is shadowing another. It also saves the overhead of managing
the TREE_LIST nodes.
Another trick to consider: Create a dummy declaration for each 'using'
declaration. In the Chill compiler, I called this an ALIAS_DECL.
An ALIAS_DECL is a declaration that appears in one scope, but is an
alias for a declaration in some other scope (namespace).
We change lookup_name so that when it gets an ALIAS_DECL, it follows the
reference to the actual declaration. (That could also be an ALIAS_DECL,
in which case you keep following the alias chain.)
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner