Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

dmd.glue.tocsym

Convert a D symbol to a symbol the linker understands (with mangled name).
Authors:

Source tocsym.d

package(dmd.glue) Symbol* toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type* t, const(char)* suffix);
Helper
package(dmd.glue) Symbol* toSymbol(Dsymbol s);
package(dmd.glue) Symbol* toImport(Dsymbol ds);
Generate import symbol from symbol.
package(dmd.glue) Symbol* toThunkSymbol(FuncDeclaration fd, int offset);
Thunks adjust the incoming 'this' pointer by 'offset'.
package(dmd.glue) Classsym* fake_classsym(Identifier id);
Fake a struct symbol.
package(dmd.glue) Symbol* toVtblSymbol(ClassDeclaration cd, bool genCsymbol = true);
This is accessible via the ClassData, but since it is frequently needed directly (like for rtti comparisons), make it directly accessible.
package(dmd.glue) Symbol* toInitializer(AggregateDeclaration ad);
Create the static initializer for the struct/class.
package(dmd.glue) Symbol* toSymbol(StructLiteralExp sle);
package(dmd.glue) Symbol* toSymbolCpp(ClassDeclaration cd);
For C++ class cd, generate an instance of _cpp_type_info_ptr and populate it with a pointer to the C++ type info.
Parameters:
ClassDeclaration cd C++ class
Returns:
symbol of instance of _cpp_type_info_ptr
package(dmd.glue) Symbol* toSymbolCppTypeInfo(ClassDeclaration cd);
Generate Symbol of C++ type info for C++ class cd.
Parameters:
ClassDeclaration cd C++ class
Returns:
Symbol of cd's rtti type info
package(dmd.glue) Symbol* toSymbol(Type t);
Turn a class type into a C Symbol.
Parameters:
Type t class type
Returns:
corresponding Symbol
package(dmd.glue) nothrow Srcpos toSrcpos(Loc loc);
Converts a Loc to backend Srcpos
Parameters:
Loc loc Source code location
Returns:
Srcpos backend struct corresponding to the given location