compiler/mir/mirpasses

  Source   Edit

Implements the various MIR-based passes. The entry point is the applyPasses procedure.

Types

TargetBackend = enum
  targetC, targetJs, targetVm
The backend that is going to consume the MIR code. Used to select what passes to run.   Source   Edit

Procs

proc applyPasses(body: var MirBody; prc: PSym; env: var MirEnv;
                 graph: ModuleGraph; target: TargetBackend) {.
    ...raises: [Exception, ERecoverableError, KeyError],
    tags: [RootEffect, ReadDirEffect].}
Applies all applicable MIR passes to the body (tree and source) of prc. target is the targeted backend and is used to enable/disable certain passes. Passes may register new entities with env.   Source   Edit