Skip to content

Commit 0416146

Browse files
committed
Update name mangling description to explicitly condone the practice of using a period-separated suffix for symbol variants.
The intent is to provide a mechanism whereby implementations can provide multiple definitions of a symbol (eg, a constant-propagated version of a function, the residual after partial inlining or dead argument elimination, a resumption function for a coroutine, ...) that are named after the original in backtraces, debuggers, and so on. Fixes #35.
1 parent 321c8e7 commit 0416146

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

abi.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4051,8 +4051,9 @@ <h4><a href="#mangling-general"> 5.1.1 General </a></h4>
40514051
or <code>Type?</code> for an unknown data type.
40524052

40534053
<p>
4054-
Grammar productions beginning with '$' are reserved for private implementation
4055-
use. Names produced using such extensions are inherently non-portable.
4054+
Mangled names containing '<tt>$</tt>' or '<tt>.</tt>' are reserved for
4055+
private implementation use. Names produced using such extensions are
4056+
inherently non-portable and should be given internal linkage where possible.
40564057

40574058
<p>
40584059
<a name="mangling-structure">
@@ -4063,6 +4064,7 @@ <h4><a href="#mangling-structure"> 5.1.2 General Structure </a></h4>
40634064
Mangled names have the general structure:
40644065
<pre><font color=blue><code>
40654066
&lt;<a name="mangle.mangled-name">mangled-name</a>&gt; ::= _Z &lt;<a href="#mangle.encoding">encoding</a>&gt;
4067+
::= _Z &lt;<a href="#mangle.encoding">encoding</a>&gt; . &lt;vendor-specific suffix&gt;
40664068
&lt;<a name="mangle.encoding">encoding</a>&gt; ::= &lt;<i>function</i> <a href="#mangle.name">name</a>&gt; &lt;<a href="#mangle.bare-function-type">bare-function-type</a>&gt;
40674069
::= &lt;<i>data</i> <a href="#mangle.name">name</a>&gt;
40684070
::= &lt;<a href="#mangle.special-name">special-name</a>&gt;
@@ -4080,6 +4082,13 @@ <h4><a href="#mangling-structure"> 5.1.2 General Structure </a></h4>
40804082
parameters).
40814083
The type is omitted for variables and static data members.
40824084

4085+
<p>
4086+
A <code>&lt;<a href="#mangle.mangled-name">mangled-name</a>&gt;</code>
4087+
containing a period represents a vendor-specific version or portion
4088+
of the entity named by the <code>&lt;<a href="#mangle.encoding">encoding</a>&gt;</code>
4089+
prior to the first period. There is no restriction on the characters
4090+
that may be used in the suffix following the period.
4091+
40834092
<a name="mangle.anonymous">
40844093
<h5><a href="#mangling.anonymous">Anonymous entities</a></h5>
40854094

@@ -5166,7 +5175,7 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
51665175
::= L &lt;<i>nullptr</i> <a href="#mangle.type">type</a>&gt; E # nullptr literal (i.e., "LDnE")
51675176
::= L &lt;<i>pointer</i> <a href="#mangle.type">type</a>&gt; 0 E # null pointer template argument
51685177
::= L &lt;<a href="#mangle.type">type</a>&gt; &lt;<i>real-part</i> <a href="#mangle.float">float</a>&gt; _ &lt;<i>imag-part</i> <a href="#mangle.float">float</a>&gt; E # complex floating point literal (C 2000)
5169-
::= L &lt;<a href="#mangle.mangled-name">mangled-name</a>&gt; E # external name
5178+
::= L _Z &lt;<a href="#mangle.encoding">encoding</a>&gt; E # external name
51705179

51715180
&lt;<a name="mangle.braced-expression">braced-expression</a>&gt; ::= &lt;<a href="#mangle.expression">expression</a>&gt;
51725181
::= di &lt;<i>field</i> <a href="#mangle.source-name">source-name</a>&gt; &lt;<a href="#mangle.braced-expression">braced-expression</a>&gt; # .name = expr
@@ -5252,7 +5261,7 @@ <h5><a href="#mangling.declaration-reference">5.1.6.2 References to declared ent
52525261
<p>
52535262
When encoding template signatures, a name appearing in the source code
52545263
cannot always be resolved to a specific entity: In such cases the
5255-
<code>&lt;<a href="#mangle.mangled-name">mangled-name</a>&gt;</code> production (via
5264+
<code>&lt;<a href="#mangle.encoding">encoding</a>&gt;</code> production (via
52565265
<code>&lt;<a href="#mangle.expr-primary">expr-primary</a>&gt;</code>) does not apply, and instead the
52575266
<code>&lt;<a href="#mangle.unresolved-name">unresolved-name</a>&gt;</code> encoding is used. For example:
52585267
<code><pre>

0 commit comments

Comments
 (0)