core.demangle

The demangle module converts mangled D symbols to a representation similar to what would have existed in code.

Types 8

aliasCXX_DEMANGLER = char * function (const char * mangled_name, char * output_buffer, size_t * length, int * status) nothrow pure @trusted
private structNoHooks
private structDemangle(Hooks = NoHooks)
Fields
const(char)[] buf
Buffer dst
size_t pos
size_t brp
AddType addType
bool mute
Hooks hooks
Methods
bool isAlpha( char val ) static pure @safe
bool isDigit( char val ) static pure @safe nothrow
bool isHexDigit( char val ) static pure @safe
ubyte ascii2hex( out bool errStatus, char val ) static pure @safe nothrow
BufSlice shift(scope const BufSlice val) pure @safe return scope
void putComma(size_t n) pure @safe
void put(char c) pure @safe return scope
void put(scope BufSlice val) pure @safe return scope
void put(scope const(char)[] val) pure @safe return scope nothrow
void putAsHex( size_t val, int width = 0 ) pure @safe
void pad( const(char)[] val ) pure @safe
void silent( out bool err_status, void delegate(out bool err_status) pure @safe nothrow dg ) pure @safe nothrow
bool empty() @property pure @safe
char front() @property pure @safe
char peek( size_t n ) pure @safe
bool test( char val ) pure @safe nothrow
void popFront() pure @safe nothrow
void popFront(int i) pure @safe nothrow
bool match( char val ) pure @safe nothrow
bool match( const(char)[] val ) pure @safe nothrow
void eat( char val ) pure @safe
bool isSymbolNameFront(out bool errStatus) pure @safe nothrow
char peekBackref() pure @safe nothrow
size_t decodeBackref(size_t peekAt = 0)() pure @safe nothrow
const(char)[] sliceNumber() pure @safe return scope
size_t decodeNumber(out bool errStatus) pure @safe scope nothrow
size_t decodeNumber( out bool errStatus, scope const(char)[] num ) pure @safe scope nothrow
void parseReal(out bool errStatus) pure @safe scope nothrow
void parseLName(out string errMsg) pure @safe scope nothrow
BufSlice parseType(out bool errStatus) pure @safe return scope nothrow
void parseCallConvention(out bool errStatus) pure @safe nothrow
ushort parseModifier() pure @safeReturns: Flags of `TypeCtor`
ushort parseFuncAttr(out bool errStatus) pure @safe nothrow
void parseFuncArguments(out bool errStatus) pure @safe scope nothrow
BufSlice parseTypeFunction(out bool errStatus, IsDelegate isdg = IsDelegate.no) pure @safe return scope nothrow
bool isCallConvention( char ch ) static pure @safe
void parseValue(out bool errStatus) pure @safe scope nothrow
void parseValue(out bool errStatus, scope BufSlice name, char type = '\0' ) pure @safe scope nothrow
void parseIntegerValue( out bool errStatus, scope BufSlice name, char type = '\0' ) pure @safe scope nothrow
void parseTemplateArgs(out bool errStatus) pure @safe scope nothrow
bool mayBeMangledNameArg() pure @safe nothrow
bool parseMangledNameArg() pure @safe nothrow
void parseTemplateInstanceName(out bool errStatus, bool hasNumber) pure @safe scope nothrow
bool mayBeTemplateInstanceName() pure @safe scope nothrow
void parseSymbolName(out bool errStatus) pure @safe scope nothrow
BufSlice parseFunctionTypeNoReturn( bool keepAttr = false ) pure @safe return scope nothrow
void parseQualifiedName(out bool errStatus) pure @safe return scope nothrow
void parseMangledName( out bool errStatus, bool displayType, size_t n = 0 ) pure @safe scope nothrow
void parseMangledName(out bool errStatus) pure @safe nothrow
char[] doDemangle(alias FUNC)() pure @safe return scope nothrow
char[] demangleName() pure @safe nothrow
char[] demangleType() pure @safe nothrow
Constructors
this( return scope const(char)[] buf_, return scope char[] dst_ = null )
this( return scope const(char)[] buf_, AddType addType_, return scope char[] dst_ = null )
Nested Templates
AddType
IsDelegate
private structManglingFlagInfo
Fields
ushort flagThe flag value to use
string valueHuman-readable representation
private enumTypeCtor : ushort
None = 0
Const = (1 << 1)/ 'x'
Immutable = (1 << 2)'y'
Shared = (1 << 3)'O'
InOut = (1 << 4)
private enumFuncAttributes : ushort
None = 0
Pure = (1 << 1)/ 'a'
Nothrow = (1 << 2)/ 'b'
Ref = (1 << 3)/ 'c'
Property = (1 << 4)/ 'd'
Trusted = (1 << 5)/ 'e'
Safe = (1 << 6)/ 'f'
NoGC = (1 << 7)/ 'i'
Return = (1 << 8)/ 'j'
Scope = (1 << 9)/ 'l'
Live = (1 << 10)/ 'm'
ReturnScope = (1 << 11)Their order matter
ScopeReturn = (1 << 12)
private structBuffer
Fields
size_t minSize
private char[] dst
private size_t len
Methods
size_t length() @safe pure const scope nothrow @nogc
BufSlice opSlice(size_t from, size_t to) @safe pure return scope nothrow @nogc
bool contains(scope const(char)[] a, scope const BufSlice b) static @safe pure nothrow
char[] copyInput(scope const(char)[] buf) @safe pure return scope nothrow
private void checkAndStretchBuf(size_t len_to_add) @safe pure scope nothrow
BufSlice shift(scope const BufSlice val) @safe pure return scope nothrow
void remove(scope BufSlice val) @safe pure scope nothrow
void append(scope const(char)[] val) @safe pure scope nothrow
private scope bslice(size_t from, size_t to) @safe pure @nogc nothrow
private static scope bslice_empty() @safe pure @nogc nothrow
private structBufSlice
Fields
char[] buf
size_t from
size_t to
Methods
auto getSlice() @safe pure nothrow inout scope
size_t length() @safe pure nothrow const scope
Constructors
this(return scope char[] buf)
this(return scope char[] buf, size_t from, size_t to, bool lastArgIsLen = false)

Functions 10

fnchar[] demangle(return scope const(char)[] buf, return scope char[] dst = null, CXX_DEMANGLER __cxa_demangle = null) nothrow pure @safeDemangles D/C++ mangled names. If it is not a D/C++ mangled name, it returns its argument name.
fnchar[] demangleType( const(char)[] buf, char[] dst = null ) nothrow pure @safeDemangles a D mangled type.
fnchar[] reencodeMangled(return scope const(char)[] mangled) nothrow pure @safereencode a mangled symbol name that might include duplicate occurrences of the same identifier by replacing all but the first occurence with a back reference.
fnchar[] mangle(T)(return scope const(char)[] fqn, return scope char[] dst = null) @safe pure nothrowMangles a D symbol.
fnchar[] mangleFunc(T: FT *, FT)(return scope const(char)[] fqn, return scope char[] dst = null) if (is(FT == function)) @safe pure nothrowMangles a D function.
private fnvoid pureReprintReal(char[] nptr) extern(C) pure @trusted @nogc nothrow
private fnvoid fakePureReprintReal(char[] nptr) extern(C)
private fnstring toStringConsume(immutable ManglingFlagInfo[] infos, ref ushort base) @safe pure nothrow @nogc
fnCXX_DEMANGLER getCXXDemangler() nothrow @trustedReturns: a CXX_DEMANGLER if a C++ stdlib is loaded
private fnchar[] demangleCXX(return scope const(char)[] buf, CXX_DEMANGLER __cxa_demangle, return scope char[] dst = null,) nothrow pure @trustedDemangles C++ mangled names. If it is not a C++ mangled name, it returns its argument name.

Variables 4

private enumvarhasTypeBackRef = (int function(void * *, void * *)).mangleof[$ - 4 .. $] == "QdZi"
private varManglingFlagInfo[] typeCtors
private varManglingFlagInfo[] funcAttrs
private varCXX_DEMANGLER __cxa_demangle

Templates 3

tmplisExternD(FT) if (is(FT == function))
tmplisExternCPP(FT) if (is(FT == function))
tmplhasPlainMangling(FT) if (is(FT == function))