This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCHes for better dumping and documentation
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCHes for better dumping and documentation
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 14 Dec 1999 10:10:18 -0800
- Organization: CodeSourcery, LLC
Here are patches to dump DECL_NAMESPACE_ALIAS and
EXPR_WITH_FILE_LOCATION.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
1999-12-14 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
* ir.texi (DECL_NAMESPACE_ALIAS): Document it.
* error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.
Index: dump.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/dump.c,v
retrieving revision 1.28
diff -c -p -r1.28 dump.c
*** dump.c 1999/12/09 09:07:29 1.28
--- dump.c 1999/12/14 18:05:47
*************** dequeue_and_dump (di)
*** 600,606 ****
and therefore many other macros do not work on it. */
if (t == std_node)
break;
! dump_child ("dcls", cp_namespace_decls (t));
break;
case TEMPLATE_DECL:
--- 603,612 ----
and therefore many other macros do not work on it. */
if (t == std_node)
break;
! if (DECL_NAMESPACE_ALIAS (t))
! dump_child ("alis", DECL_NAMESPACE_ALIAS (t));
! else
! dump_child ("dcls", cp_namespace_decls (t));
break;
case TEMPLATE_DECL:
Index: ir.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/ir.texi,v
retrieving revision 1.23
diff -c -p -r1.23 ir.texi
*** ir.texi 1999/12/05 00:49:26 1.23
--- ir.texi 1999/12/14 18:05:52
*************** same name.
*** 617,622 ****
--- 617,633 ----
This macro returns the enclosing namespace. The @code{DECL_CONTEXT} for
the @code{global_namespace} is @code{NULL_TREE}.
+ @item DECL_NAMESPACE_ALIAS
+
+ If this declaration is for a namespace alias, then
+ @code{DECL_NAMESPACE_ALIAS} is the namespace for which this one is an
+ alias.
+
+ Do not attempt to use @code{cp_namespace_decls} for a namespace which is
+ an alias. Instead, follow @code{DECL_NAMESPACE_ALIAS} links until you
+ reach an ordinary, non-alias, namespace, and call
+ @code{cp_namespace_decls} there.
+
@item cp_namespace_decls
This function will return the declarations contained in the namespace,
including types, overloaded functions, other namespaces, and so forth.
*************** For more information on the kinds of dec
*** 636,641 ****
--- 647,655 ----
list, @xref{Declarations}. Some declarations will not appear on this
list. In particular, no @code{FIELD_DECL}, @code{LABEL_DECL}, or
@code{PARM_DECL} nodes will appear here.
+
+ This function cannot be used with namespaces that have
+ @code{DECL_NAMESPACE_ALIAS} set.
@end ftable
Index: error.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/error.c,v
retrieving revision 1.96
diff -c -p -r1.96 error.c
*** error.c 1999/11/23 02:49:41 1.96
--- error.c 1999/12/14 18:06:24
*************** dump_expr (t, flags)
*** 1817,1822 ****
--- 1817,1826 ----
dump_expr (TREE_OPERAND (t, 0), flags);
break;
+ case EXPR_WITH_FILE_LOCATION:
+ dump_expr (EXPR_WFL_NODE (t), flags);
+ break;
+
case CONSTRUCTOR:
if (TREE_TYPE (t) && TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
{