cgen

Source   Edit  

This module implements the C code generator.This include file contains the logic to produce constant string and seq literals. The code here is responsible that const x = ["a", "b"] works without hidden runtime creation code. The price is that seqs and strings are not purely a library implementation.Generates traversal procs for the C backend.Code specialization instead of the old, incredibly slow 'genericReset' implementation.Thread var support for architectures that lack native support for thread local storage.

Procs

proc cgenWriteModules(backend: RootRef; config: ConfigRef) {....raises: [Exception,
    OSError, KeyError, ValueError, IOError, ERecoverableError], tags: [
    RootEffect, WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    TimeEffect, WriteDirEffect], forbids: [].}
Source   Edit  
proc fillObjectFields(m: BModule; typ: PType) {....raises: [Exception, ValueError,
    KeyError, IOError, ERecoverableError, OSError], tags: [RootEffect,
    ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
Source   Edit  
proc finalCodegenActions(graph: ModuleGraph; m: BModule; n: PNode) {....raises: [
    Exception, OSError, KeyError, ValueError, IOError, ERecoverableError], tags: [
    RootEffect, WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    TimeEffect], forbids: [].}
Also called from IC. Source   Edit  
proc genProcLvl3(m: BModule; prc: PSym) {....raises: [Exception, OSError, KeyError,
    ValueError, IOError, ERecoverableError], tags: [RootEffect, WriteIOEffect,
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, TimeEffect], forbids: [].}
Source   Edit  
proc genTopLevelStmt(m: BModule; n: PNode) {....raises: [Exception, OSError,
    KeyError, ValueError, IOError, ERecoverableError], tags: [RootEffect,
    WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect, TimeEffect],
    forbids: [].}
Also called from ic/cbackend.nim. Source   Edit  
proc genTypeInfo(config: ConfigRef; m: BModule; t: PType; info: TLineInfo): Rope {....raises: [
    Exception, OSError, KeyError, ValueError, IOError, ERecoverableError], tags: [
    RootEffect, WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect],
    forbids: [].}
Source   Edit  
proc multiFormat(frmt: var string; chars: static openArray[char];
                 args: openArray[seq[string]])
Source   Edit  
proc newModule(g: BModuleList; module: PSym; conf: ConfigRef; idgen: IdGenerator): BModule {.
    ...raises: [Exception, OSError, KeyError, ValueError, IOError], tags: [
    RootEffect, WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect],
    forbids: [].}
Source   Edit  
proc registerInitProcs(g: BModuleList; m: PSym; flags: set[ModuleBackendFlag]) {.
    ...raises: [Exception, OSError, KeyError, ValueError, IOError], tags: [
    RootEffect, WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect],
    forbids: [].}
Called from the IC backend. Source   Edit  
proc setupCgen(graph: ModuleGraph; module: PSym; idgen: IdGenerator): PPassContext {.
    ...raises: [Exception, OSError, KeyError, ValueError, IOError], tags: [
    RootEffect, WriteIOEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    WriteDirEffect], forbids: [].}
Source   Edit  
proc whichInitProcs(m: BModule): set[ModuleBackendFlag] {....raises: [], tags: [],
    forbids: [].}
Source   Edit  

Templates

template cgDeclFrmt(s: PSym): string
Source   Edit