cgendata

Source   Edit  

This module contains the data structures for the C code generation phase.

Types

BModule = ref TCGen
Source   Edit  
BModuleList = ref object of RootObj
  mainModProcs*, mainModInit*, otherModsInit*, mainDatInit*: Builder
  mapping*: Rope
  modules*: seq[BModule]
  modulesClosed*: seq[BModule]
  forwardedProcs*: seq[PSym]
  generatedHeader*: BModule
  typeInfoMarker*: TypeCacheWithOwner
  typeInfoMarkerV2*: TypeCacheWithOwner
  config*: ConfigRef
  graph*: ModuleGraph
  strVersion*, seqVersion*: int
  nimtv*: Builder
  nimtvDeps*: seq[PType]
  nimtvDeclared*: IntSet
  mangledPrcs*: HashSet[string]
Source   Edit  
BProc = ref TCProc
Source   Edit  
CodegenFlag = enum
  preventStackTrace, usesThreadVars, frameDeclared, isHeaderFile,
  includesStringh, objHasKidsValid, useAliveDataFromDce
Source   Edit  
TBlock = object
  id*: int
  label*: Rope
  sections*: TCProcSections
  isLoop*: bool
  nestedTryStmts*: int16
  nestedExceptStmts*: int16
  frameLen*: int16
Source   Edit  
TCFileSection = enum
  cfsHeaders, cfsFrameDefines, cfsForwardTypes, cfsTypes, cfsSeqTypes,
  cfsTypeInfo, cfsProcHeaders, cfsStrData, cfsData, cfsVars, cfsProcs,
  cfsInitProc, cfsDatInitProc, cfsTypeInit1, cfsTypeInit3, cfsDynLibInit
Source   Edit  
TCFileSections = array[TCFileSection, Builder]
Source   Edit  
TCProcFlag = enum
  beforeRetNeeded, threadVarAccessed, hasCurFramePointer, noSafePoints,
  nimErrorFlagAccessed, nimErrorFlagDeclared, nimErrorFlagDisabled
Source   Edit  
TCProcSection = enum
  cpsLocals, cpsInit, cpsStmts
Source   Edit  
TCProcSections = array[TCProcSection, Builder]
Source   Edit  
TCTypeKind = enum
  ctVoid, ctChar, ctBool, ctInt, ctInt8, ctInt16, ctInt32, ctInt64, ctFloat,
  ctFloat32, ctFloat64, ctFloat128, ctUInt, ctUInt8, ctUInt16, ctUInt32,
  ctUInt64, ctArray, ctPtrToArray, ctStruct, ctPtr, ctNimStr, ctNimSeq, ctProc,
  ctCString
Source   Edit  
Source   Edit  
Source   Edit  
Source   Edit  
TypeCacheWithOwner = Table[SigHash, tuple[str: Rope, owner: int32]]
Source   Edit  

Procs

proc includeHeader(this: BModule; header: string) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc initBlock(): TBlock {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc newModuleList(g: ModuleGraph): BModuleList {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc newProc(prc: PSym; module: BModule): BProc {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc procSec(p: BProc; s: TCProcSection): var Builder {.inline, ...raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc s(p: BProc; s: TCProcSection): var Builder {.inline, ...raises: [], tags: [],
    forbids: [].}
Source   Edit  

Iterators

iterator cgenModules(g: BModuleList): BModule {....raises: [], tags: [],
    forbids: [].}
Source   Edit  

Templates

template config(m: BModule): ConfigRef
Source   Edit  
template config(p: BProc): ConfigRef
Source   Edit  
template vccAndC(p: BProc): bool
Source   Edit