name mangling: bring documentation closer to actual implementation#1511
name mangling: bring documentation closer to actual implementation#1511MartinNowak merged 1 commit intodlang:masterfrom
Conversation
| $(GNAME SymbolName): | ||
| $(B 0) $(GREEN // anonymous symbols) | ||
| $(GLINK LName) | ||
| $(GLINK TemplateInstanceName) |
There was a problem hiding this comment.
Let's move the less common anonymous symbol case to the bottom.
There was a problem hiding this comment.
Amended.
BTW: I've only seen this with overload sets as template arguments, but it looks like a bug to me: the overloaded symbol has these anonymous parents, but something like the location of the lookup should be encoded instead.
672a9d5 to
6230e59
Compare
|
@rainers: how about linking to the bison spec file that you curated? I imagine that this could help other people as well (at least those reading the spec about name mangling) |
|
@wilzbach A bison grammar matching the documentation is now here: https://gist.githubusercontent.com/rainers/6cdf73b48837defb9f88/raw/0028d4aed82b0abf2a5a32322398ebe4595903bb/dwebsite3.bison Not sure where to place and link to it. I think it would have to be part of the dlang.org repository to have a chance of staying in sync. BTW: It shows 2 ambiguities in the grammar:
|
How about creating a new |
|
IMO? Put it in the same directory as the name mangling spec.
Also weird, can't comment via the web interface:
https://dump.thecybershadow.net/3b56e04862e0c61b7e3135ac95d3b129/13%3A14%3A06-upload.png
…On 2016-12-19 08:30, Sebastian Wilzbach wrote:
> Not sure where to place and link to it. I think it would have to be part of the dlang.org repository to have a chance of staying in sync.
How about creating a new `data` or `bison` folder?
What is your opinion @CyberShadow?
--
Best regards,
Vladimir
|
| $(B V) $(GLINK Type) $(GLINK Value) | ||
| $(B S) $(GLINK LName) | ||
| $(B S) $(GLINK SymbolName) | ||
| $(B S) $(GLINK MangledName) |
There was a problem hiding this comment.
Actually, this should be QualifiedName / MangledName.
Instantiates this symbol:
std.parallelism.Task!(run, real delegate(MapResult!(getTerm, Result), ulong, ulong) @system, MapResult!(getTerm, Result), ulong, ulong).Task.impl
Mangled as:
_D3std11parallelism301__T4TaskS213std11parallelism3runTDFS3std9algorithm9iteration91__T9MapResultS31_D8parallel4mainFZ7getTermMFiZeTS3std5range13__T4iotaTiTiZ4iotaFiiZ6ResultZ9MapResultmmZeTS3std9algorithm9iteration91__T9MapResultS31_D8parallel4mainFZ7getTermMFiZeTS3std5range13__T4iotaTiTiZ4iotaFiiZ6ResultZ9MapResultTmTmZ4Task4implFPvZv
Right at the beginning of the first template you have:
__T4TaskS213std11parallelism3run
^
Also, this cunningly forgets Bugzilla 3043 where symbol arguments are prefixed with their length.
The correct grammar should be:
$(GNAME TemplateArgX):
$(B T) $(GLINK Type)
$(B V) $(GLINK Type) $(GLINK Value)
$(B S) $(GLINK Number) $(GLINK QualifiedName)
$(B S) $(GLINK Number) $(GLINK MangledName)
There was a problem hiding this comment.
Yeah, noticed this too last night, see https://issues.dlang.org/show_bug.cgi?id=14591#c7
This documents what I found in the current implementation. Not everything seems desirable, though...