# dmd.compiler

Describes a back-end `compiler` and implements `compiler`-specific actions.

#### Authors

Walter Bright

#### License

Boost License 1.0

Source: compiler.d

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

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

- `Compiler`

  #### Declaration

  `struct `Compiler`;`

  A data structure that describes a back-end compiler and implements compiler-specific actions.

  - `paintAsType`

    #### Declaration

    `static Expression `paintAsType`(UnionExp* `pue`, Expression `e`, Type `type`);`

    Encode the given expression, which is assumed to be an rvalue literal as another `type` for use in CTFE. This corresponds roughly to the idiom *(Type *)&`e`.

  - `onParseModule`

    #### Declaration

    `static void `onParseModule`(Module `m`);`

    For the given module, perform any post parsing analysis. Certain compiler backends (ie: GDC) have special placeholder modules whose source are empty, but code gets injected immediately after loading.

  - `onImport`

    #### Declaration

    `static bool `onImport`(Module `m`);`

    A callback function that is called once an imported module is parsed. If the callback returns `true`, then it tells the frontend that the driver intends on compiling the import.