# compiler/liftdestructors

Dark Mode

- Index

Search:
Group by:
Source Edit

This module implements lifting for type-bound operations (`=sink`, `=`, `=destroy`, `=deepCopy`).

# Imports

modulegraphs, lineinfos, idents, ast, renderer, semdata, sighashes, lowerings, options, types, msgs, magicsys, ccgutils, trees

# Procs

    proc boolLit(g: ModuleGraph; info: TLineInfo; value: bool): PNode {.
        ...raises: [KeyError, Exception, ValueError, IOError, ERecoverableError], tags: [
        ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType;
                            info: TLineInfo; idgen: IdGenerator) {....raises: [OSError,
        Exception, KeyError, ValueError, IOError, ERecoverableError], tags: [
        RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  In the semantic pass this is called in strategic places to ensure we lift assignment, destructors and moves properly. The later 'injectdestructors' pass depends on it. Source Edit

    proc cyclicType(t: PType): bool {....raises: [Exception], tags: [RootEffect].}

  Source Edit

    proc genBuiltin(g: ModuleGraph; idgen: IdGenerator; magic: TMagic; name: string;
                    i: PNode): PNode {....raises: [], tags: [].}

  Source Edit

    proc produceDestructorForDiscriminator(g: ModuleGraph; typ: PType; field: PSym;
                                           info: TLineInfo; idgen: IdGenerator): PSym {....raises: [
        KeyError, Exception, ValueError, IOError, ERecoverableError, OSError], tags: [
        ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

# Templates

    template asink(t: PType): PSym

  Source Edit

    template assignment(t: PType): PSym

  Source Edit

    template destructor(t: PType): PSym

  Source Edit

    template liftTypeBoundOps(c: PContext; typ: PType; info: TLineInfo)

  Source Edit