[cxx-abi-dev] Mangling of anonymous unions?

Mark Mitchell mark at codesourcery.com
Mon Dec 23 05:02:37 UTC 2002



--On Thursday, December 19, 2002 08:43:27 AM -0500 "J. Stephen Adamczyk" 
<jsa at edg.com> wrote:

> Mark Mitchell writes:
>> I think that the first name found in a pre-order, depth-first,
>> declaration-order walk is a reasonable choice.
>
> I agree.  We already do exactly that in our other (non-IA-64)
> name mangling scheme.

I think we've got consensus.  I checked in this patch.

-- 
Mark Mitchell                mark at codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com

Index: abi.html
===================================================================
RCS file: /usr/local/Repository/cxx-abi/abi.html,v
retrieving revision 1.55
diff -c -5 -p -r1.55 abi.html
*** abi.html	12 Dec 2002 19:13:30 -0000	1.55
--- abi.html	23 Dec 2002 05:04:07 -0000
*************** and in the case of functions its type (t
*** 3858,3867 ****
--- 3858,3888 ----
  At this top level,
  function types do not have the special delimiter characters required
  when nested (see below).
  The type is omitted for variables and static data members.

+ <p>
+ For the purposes of mangling, the name of an anonymous union is
+ considered to be the name of the first named data member found by a
+ pre-order, depth-first, declaration-order walk of the data members of
+ the anonymous union.  If there is no such data member (i.e., if all of
+ the data members in the union are unnamed), then there is no way for a
+ program to refer to the anonymous union, and there is therefore no
+ need to mangle its name.
+ </p>
+
+ <p>
+ All of these examples:
+ <blockquote><code><pre>
+ union { int i; int j; };
+ union { union { int : 7 }; union { int i; }; };
+ union { union { int j; } i; };
+ </pre></code></blockquote>
+ are considered to have the name <code>i</code> for the purposes of
+ mangling.
+ </p>
+
  <pre><font color=blue><code>
      <name> ::= <nested-name>
  	   ::= <unscoped-name>
  	   ::= <unscoped-template-name> <template-args>
  	   ::= <local-name>	# See <a href=#mangling-scope>Scope Encoding</a> 
below
*************** unwind table location.
*** 4918,4927 ****
--- 4939,4952 ----

  <p> <hr> <p>
  <a name=revisions>
  <h2> Appendix R: Revision History </h2>
  <p> <hr> <p>
+
+ <p>
+ <font color=blue>[021222]</font>
+ Document mangling for anonymous unions.

  <p>
  <font color=blue>[021204]</font>
  Remove note about 32-bit RTTI variation.





More information about the cxx-abi-dev mailing list