This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Slight modification of namespace patch
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Slight modification of namespace patch
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Thu, 05 Jul 2001 16:19:48 -0400
This adds support for namespace aliases.
I only changed gen_namespace_die.
It now looks like this:
*************** is_redundant_typedef (decl)
*** 10795,10800 ****
--- 10802,10845 ----
return 0;
}
+ /* Generate a DIE for a namespace or namespace alias */
+ static void
+ gen_namespace_die (decl, context_die)
+ register tree decl;
+ register dw_die_ref context_die;
+ {
+ /* Namespace aliases have a DECL_ABSTRACT_ORIGIN of the namespace
+ they are an alias of.*/
+ if (DECL_ABSTRACT_ORIGIN (decl) == NULL)
+ {
+ /* Output a real namespace */
+ dw_die_ref namespace_die = new_die (DW_TAG_namespace, context_die);
+ add_name_and_src_coords_attributes (namespace_die, decl);
+ equate_decl_number_to_die (decl, namespace_die);
+ }
+ else
+ {
+ /* Output a namespace alias */
+ dw_die_ref namespace_die;
+
+ /* Force out the namespace we are an alias of, if necessary */
+ dw_die_ref origin_die = lookup_decl_die (DECL_ABSTRACT_ORIGIN (decl));
+ if (!origin_die)
+ {
+ /* Attempt to force out origin. */
+ dwarf2out_decl (DECL_ABSTRACT_ORIGIN (decl));
+ origin_die = lookup_decl_die (DECL_ABSTRACT_ORIGIN (decl));
+ if (!origin_die)
+ abort();
+ }
+ /* Now create the namespace alias DIE. */
+ namespace_die = new_die (DW_TAG_imported_declaration, context_die);
+ add_name_and_src_coords_attributes (namespace_die, decl);
+ add_AT_die_ref (namespace_die, DW_AT_import, origin_die);
+ equate_decl_number_to_die (decl, namespace_die);
+ }
+ }
+
/* Generate Dwarf debug information for a decl described by DECL. */
static void
--
"This is my impression of a bowling ball... (Drags the mike
along the floor, then lifts it...) Gutter...
"-Steven Wright