2 * Defines the building blocks for creating the mangled names for basic types.
4 * Copyright: Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved
5 * License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
6 * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/basicmangle.d, _basicmangle.d)
7 * Documentation: https://dlang.org/phobos/dmd_basicmangle.html
8 * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/basicmangle.d
10 module dmd
.basicmangle
;
13 import dmd
.common
.outbuffer
: OutBuffer
;
15 /// Type mangling mapping for basic, derived and user defined types
16 immutable char[TMAX
] mangleChar
=
51 Tfunction
: 'F', // D function
58 // M // has this, or scope
59 // N // Nh:vector Ng:wild Nn:noreturn
62 // Q // Type/symbol/identifier backward reference
67 // W // Windows function
68 // X // variadic T t...)
69 // Y // variadic T t,...)
70 // Z // not variadic, end of parameters
72 // '@' shouldn't appear anywhere in the deco'd names
84 Tnoreturn
: '@', // becomes 'Nn'
89 foreach (i
, mangle
; mangleChar
)
91 if (mangle
== char.init
)
93 import core
.stdc
.stdio
;
94 fprintf(stderr
, "ty = %u\n", cast(uint)i
);
100 /***********************
101 * Mangle basic type ty to buf.
103 void tyToDecoBuffer(ref OutBuffer buf
, int ty
) @safe
105 const c
= mangleChar
[ty
];
108 buf
.writeByte(ty
== Tint128 ?
'i' : 'k');