☰

# ic/dce

Theme:

- Index

Search:
Group by:
Source Edit

Dead code elimination (=DCE) for IC.

# Imports

../ast, ../options, ../lineinfos, ../types, packed_ast, ic, bitabs

# Types

    AliveContext = object

  Purpose is to fill the 'alive' field. Source Edit

    AliveSyms = seq[IntSet]

  Source Edit

# Procs

    proc computeAliveSyms(g: PackedModuleGraph; conf: ConfigRef): AliveSyms {.
        ...raises: [KeyError, ValueError, OSError], tags: [ReadDirEffect, RootEffect],
        forbids: [].}

  Entry point for our DCE algorithm. Source Edit

    proc isAlive(a: AliveSyms; module: int; item: int32): bool {....raises: [],
        tags: [], forbids: [].}

  Backends use this to query if a symbol is `alive` which means we need to produce (C/C++/etc) code for it. Source Edit