# dmd.tocsym

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

#### Authors

Walter Bright

#### License

Boost License 1.0

Source: tocsym.d

Documentation: https://dlang.org/phobos/dmd_tocsym.html

Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/tocsym.d

- `toSymbolX`

  #### Declaration

  `Symbol* `toSymbolX`(Dsymbol `ds`, const(char)* `prefix`, int `sclass`, type* `t`, const(char)* `suffix`);`

  Helper

- `toSymbol`

  #### Declaration

  `Symbol* `toSymbol`(Dsymbol `s`);`

- `toImport`

  #### Declaration

  `Symbol* `toImport`(Symbol* `sym`, Loc `loc`);`

- `toImport`

  #### Declaration

  `Symbol* `toImport`(Dsymbol `ds`);`

  Generate import symbol from symbol.

- `toThunkSymbol`

  #### Declaration

  `Symbol* `toThunkSymbol`(FuncDeclaration `fd`, int `offset`);`

  Thunks adjust the incoming 'this' pointer by '`offset`'.

- `fake_classsym`

  #### Declaration

  `Classsym* `fake_classsym`(Identifier `id`);`

  Fake a struct symbol.

- `toVtblSymbol`

  #### Declaration

  `Symbol* `toVtblSymbol`(ClassDeclaration `cd`);`

  This is accessible via the ClassData, but since it is frequently needed directly (like for rtti comparisons), make it directly accessible.

- `toInitializer`

  #### Declaration

  `Symbol* `toInitializer`(AggregateDeclaration `ad`);`

  Create the static initializer for the struct/class.

- `aaGetSymbol`

  #### Declaration

  `Symbol* `aaGetSymbol`(TypeAArray `taa`, const(char)* `func`, int `flags`);`

  Determine the right symbol to look up an associative array element.

  Input: `flags` 0 don't add value signature 1 add value signature

- `toSymbol`

  #### Declaration

  `Symbol* `toSymbol`(StructLiteralExp `sle`);`

- `toSymbolCpp`

  #### Declaration

  `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

  #### Return Value

  symbol of instance of _cpp_type_info_ptr

- `toSymbolCppTypeInfo`

  #### Declaration

  `Symbol* `toSymbolCppTypeInfo`(ClassDeclaration `cd`);`

  Generate Symbol of C++ type info for C++ class `cd`.

  #### Parameters

  `ClassDeclaration `cd`` | C++ class

  #### Return Value

  Symbol of `cd`'s rtti type info