compiler/sem/passes

  Source   Edit

This module implements the passes functionality. A pass must implement the TPass interface.

Types

TPassData = tuple[input: PNode, closeOutput: PNode]
  Source   Edit

Procs

proc clearPasses(g: ModuleGraph) {....raises: [], tags: [].}
  Source   Edit
proc makePass(open: TPassOpen = nil; process: TPassProcess = nil;
              close: TPassClose = nil; isFrontend = false): TPass {....raises: [],
    tags: [].}
a pass is a tuple of procedure vars TPass.close may produce additional nodes. These are passed to the other close procedures. This mechanism used to be used for the instantiation of generics.   Source   Edit
proc moduleHasChanged(graph: ModuleGraph; module: PSym): bool {.inline,
    ...raises: [], tags: [].}
  Source   Edit
proc processModule(graph: ModuleGraph; module: PSym; idgen: IdGenerator;
                   defaultStream: PLLStream): bool {.discardable, ...raises: [
    Exception, ERecoverableError, IOError, ValueError, KeyError, OSError], tags: [
    RootEffect, ReadIOEffect, ReadDirEffect, WriteIOEffect, WriteDirEffect,
    ReadEnvEffect].}
  Source   Edit
proc registerPass(g: ModuleGraph; p: TPass) {.
    ...raises: [Exception, ERecoverableError], tags: [RootEffect].}
  Source   Edit
proc skipCodegen(config: ConfigRef; n: PNode): bool {.inline, ...raises: [],
    tags: [].}
can be used by codegen passes to determine whether they should do something with n. Currently, this ignores n and uses the global error count instead.   Source   Edit