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: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: 09 Dec 2003 02:31:59 +0100
- Subject: Re: [C++] PATCH to give the anonymous namespace a null DECL_NAME
- Organization: Integrable Solutions
- References: <xypzne3tgkd.fsf@miranda.boston.redhat.com><jm8ylmzsy8.fsf@desire.geoffk.org>
Geoff Keating <geoffk@geoffk.org> writes:
| 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)?
Why? What does it buy?
| 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.
I don't understand this. Currently (I mean without IMA) , you can
have as many unnamed namespaces as you want in a given translation
unit.
-- Gaby