[cxx-abi-dev] Mangling C++0x Lambdas

David Vandevoorde daveed at edg.com
Tue Jul 28 20:37:40 UTC 2009



A couple of months ago I posted a patch for the ABI that would address  
lambdas, but we quickly found some problems with that proposal.

Finally, I've gotten back to that problem, and attached is the revised  
proposal.  These diffs do a couple of things:

1. They address the issues with local name discriminators that I  
brought up in my message of June 22nd (subject "Local name  
discriminators") by (a) enshrining the GCC approach to basing the  
discriminators on the top-level local name only, and (b) introducing a  
different discriminator encoding when more than one discriminator  
digit is required (to avoid the ambiguity that otherwise ensues).

2. They provide encodings for unnamed class/enum types with a "base  
name" Ut<n> (<n> a small integer) in contexts where the C++0x ODR  
requires them to be matched across translation units (because C++0x  
allows such types to appear in linkable signatures both via decltype  
and via template arguments).

3. The provide encodings for closure types in contexts where the C++0x  
ODR requires them to be matched across translation units, which  
includes the usual inline and template function bodies, but also (a)  
certain default and arguments and (b) certain class member  
initializers.  (I've introduced a separate "Closure Types" subsection  
for these.)

4. I've replaced the examples in "Scope Encoding" (they contained  
errors, and new examples were desirable anyway to illustrate some of  
the points above).

My colleague has implemented the encoding and decoding of these, and  
after shaking down some subtleties, we think the proposed scheme is  
solid (unambiguous and reversible, and allowing for useful information  
when appearing in demangled form in diagnostics).

Let me know if you see a problem with this.

	Daveed




-------------- next part --------------
A non-text attachment was scrubbed...
Name: ia64_lambda-2.diffs
Type: application/octet-stream
Size: 15761 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20090728/894db08d/attachment.obj>


More information about the cxx-abi-dev mailing list