compiler/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.

Consts

cgenPass = (myOpen, myProcess, myClose, false)
Source   Edit  

Procs

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

Templates

template cgDeclFrmt(s: PSym): string
Source   Edit