This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++] PATCH to give the anonymous namespace a null DECL_NAME


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]