[PATCH]: Namespace support for dwarf2
Jason Merrill
jason@redhat.com
Mon Nov 25 22:50:00 GMT 2002
On Sat, 16 Nov 2002 14:51:32 -0500 (EST), Daniel Berlin <dberlin@dberlin.org> wrote:
> 2002-11-16 Daniel Berlin <dberlin@dberlin.org>
>
> * dwarf2out.c (force_out_decl): New function.
I think a better name for this function would be setup_namespace_context or
some such. It doesn't actually do anything to the decl.
> (gen_namespace_die): New function.
> (scope_die_for): Handle namespaces.
> (class_scope_p): Ditto.
If namespaces now qualify, the name of this function is wrong.
class_or_namespace_scope_p should suffice, though something more abstract
might be nice.
> +/* 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, decl);
> + if (DECL_NAME (decl) == anonymous_namespace_name)
> + add_src_coords_attributes (namespace_die, decl);
> + else
> + add_name_and_src_coords_attributes (namespace_die, decl);
I'm not sure that giving namespaces source position information is that
useful. I suppose it won't increase debug info size that much, though.
> /* If we are in terse mode, don't generate any DIEs for types. */
> if (debug_info_level <= DINFO_LEVEL_TERSE)
> + case NAMESPACE_DECL:
> + if (debug_info_level <= DINFO_LEVEL_TERSE)
> + return;
> + if (lookup_decl_die (decl) != NULL)
> + return;
> + break;
> +
> return;
This looks like a misapplied patch.
Jason
More information about the Gcc-patches
mailing list