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: namespaces -- time to do something?


> 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


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