[dmd-internals] Correction to name mangling doc

Sean Kelly sean at invisibleduck.org
Mon Aug 30 20:58:23 PDT 2010


One other thing.  The ABI has "i Number" under "Value" for templates, but demangle() doesn't handle this and the ABI is totally silent on what it is.  Any idea?  I suppose I could just check the DMD source though.

On Aug 30, 2010, at 2:22 PM, Sean Kelly wrote:

> I'd love for the current scheme to be considered a bug because it requires arbitrary lookahead to determine whether a symbol represents a template (see demangle.parseSymbolName, for example).  If the leading Number were removed then testing for template vs. LName would basically be a matter of checking for a digit vs. underscore.  For symbol names I've always followed C conventions, but I don't think the compiler restricts symbol names at all.
> 
> On Aug 30, 2010, at 1:00 PM, Don Clugston wrote:
> 
>> I'm not sure. See bug 3034 "Template instance name wrongly mangled as
>> LName". I don't know if that bug report is valid -- is it legal to
>> have a module name which starts with double underscores??? It does
>> seem to be accepted, though.
>> 
>> We need to either change the spec and mark the bug as invalid, or else
>> change the compiler and leave the spec as-is.
>> Another related mangling bug is 3043 "Template symbol arg cannot be
>> demangled", which I think is probably invalid.
>> 
>> On 30 August 2010 21:20, Sean Kelly <sean at invisibleduck.org> wrote:
>>> The ABI says this:
>>> 
>>> TemplateInstanceName:
>>>    __T LName TemplateArgs Z
>>> 
>>> and I think it should be:
>>> 
>>> TemplateInstanceName:
>>>    Number __T LName TemplateArgs Z
>>> 
>>> Any objection to my fixing it?
>>> _______________________________________________
>>> dmd-internals mailing list
>>> dmd-internals at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>>> 
>> _______________________________________________
>> dmd-internals mailing list
>> dmd-internals at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-internals
> 
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals



More information about the dmd-internals mailing list