This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] PATCH to give the anonymous namespace a null DECL_NAME
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 08 Dec 2003 17:21:51 -0800
- Subject: Re: [C++] PATCH to give the anonymous namespace a null DECL_NAME
- References: <xypzne3tgkd.fsf@miranda.boston.redhat.com>
Jason Merrill <jason@redhat.com> writes:
> Dan Berlin recently submitted a patch to dwarf2out.c for namespace support,
> which would avoid giving the anonymous namespace a name attribute by
> exporting anonymous_namespace_name to language-independent code. I thought
> it would be cleaner to just give the anonymous namespace a null DECL_NAME;
> this patch implements that. The name for use in mangling is assigned to
> DECL_ASSEMBLER_NAME instead.
>
> Tested x86_64-pc-linux-gnu, held off pending Mark's approval for the
> accompanying dwarf2out.c patch.
Could you give the NULL in this case a different name (that is, use
ANONYMOUS_NAMESPACE rather than NULL_TREE)?
When we get IMA for C++, we will have multiple anonymous namespaces in
the same program, and they can't all be NULL_TREE. The name will make
it easier to find all the places that need to be changed.
> 2003-12-08 Jason Merrill <jason@redhat.com>
>
> Give the anonymous namespace a null DECL_NAME.
> * cp-tree.h: Don't declare anonymous_namespace_name.
> * decl.c: Don't define it.
> * dump.c (cp_dump_tree): Don't check for it.
> * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise.
> * error.c (dump_decl): Likewise.
> * name-lookup.c: Define it here.
> (push_namespace): Put it in DECL_ASSEMBLER_NAME instead.
> * mangle.c (write_unqualified_name): Adjust.
--
- Geoffrey Keating <geoffk@geoffk.org>