namespaces -- time to do something?

Per Bothner bothner@cygnus.com
Wed Dec 10 19:28:00 GMT 1997


> 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



More information about the Gcc mailing list