compiler/ic/ic

    Dark Mode
Search:
Group by:
  Source   Edit

Types

LoadedModule = object
  status*: ModuleStatus
  symsInit, typesInit, loadedButAliveSetChanged*: bool
  fromDisk*: PackedModule
  syms: seq[PSym]
  types: seq[PType]
  module*: PSym
  iface, ifaceHidden: Table[PIdent, seq[PackedItemId]]
  Source   Edit
ModuleBackendFlag = enum
  HasDatInitProc, HasModuleInitProc
  Source   Edit
ModuleStatus = enum
  undefined, storing, loading, loaded, outdated, stored
  Source   Edit
PackedConfig = object
  backend: TBackend
  selectedGC: TGCMode
  cCompiler: TSystemCC
  options: TOptions
  globalOptions: TGlobalOptions
  Source   Edit
PackedDecoder = object
  lastModule: int
  lastLit: LitId
  lastFile: FileIndex
  config*: ConfigRef
  cache*: IdentCache
  Source   Edit
PackedEncoder = object
  thisModule*: int32
  lastFile*: FileIndex
  lastLit*: LitId
  filenames*: Table[FileIndex, LitId]
  pendingTypes*: seq[PType]
  pendingSyms*: seq[PSym]
  typeMarker*: IntSet
  symMarker*: IntSet
  config*: ConfigRef
  Source   Edit
PackedModule = object
  definedSymbols: string
  moduleFlags: TSymFlags
  includes*: seq[(LitId, string)]
  imports: seq[LitId]
  toReplay*: PackedTree
  topLevel*: PackedTree
  bodies*: PackedTree
  exports*: seq[(LitId, int32)]
  hidden*: seq[(LitId, int32)]
  reexports*: seq[(LitId, PackedItemId)]
  compilerProcs*: seq[(LitId, int32)]
  converters*, methods*, trmacros*, pureEnums*: seq[int32]
  macroUsages*: seq[(PackedItemId, PackedLineInfo)]
  typeInstCache*: seq[(PackedItemId, PackedItemId)]
  procInstCache*: seq[PackedInstantiation]
  attachedOps*: seq[(TTypeAttachedOp, PackedItemId, PackedItemId)]
  methodsPerType*: seq[(PackedItemId, int, PackedItemId)]
  enumToStringProcs*: seq[(PackedItemId, PackedItemId)]
  emittedTypeInfo*: seq[string]
  backendFlags*: set[ModuleBackendFlag]
  syms*: seq[PackedSym]
  types*: seq[PackedType]
  strings*: BiTable[string]
  numbers*: BiTable[BiggestInt]
  cfg: PackedConfig
the parts of a PackedEncoder that are part of the .rod file   Source   Edit
RodIter = object
  decoder: PackedDecoder
  values: seq[PackedItemId]
  i, module: int
  Source   Edit

Procs

proc addCompilerProc(c: var PackedEncoder; m: var PackedModule; s: PSym) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addConverter(c: var PackedEncoder; m: var PackedModule; s: PSym) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addExported(c: var PackedEncoder; m: var PackedModule; s: PSym) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addHidden(c: var PackedEncoder; m: var PackedModule; s: PSym) {....raises: [],
    tags: [].}
  Source   Edit
proc addImportFileDep(c: var PackedEncoder; m: var PackedModule; f: FileIndex) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addIncludeFileDep(c: var PackedEncoder; m: var PackedModule; f: FileIndex) {.
    ...raises: [IOError], tags: [ReadIOEffect].}
  Source   Edit
proc addMethod(c: var PackedEncoder; m: var PackedModule; s: PSym) {....raises: [],
    tags: [].}
  Source   Edit
proc addPragmaComputation(c: var PackedEncoder; m: var PackedModule; n: PNode) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addPureEnum(c: var PackedEncoder; m: var PackedModule; s: PSym) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addReexport(c: var PackedEncoder; m: var PackedModule; s: PSym) {.
    ...raises: [], tags: [].}
  Source   Edit
proc addTrmacro(c: var PackedEncoder; m: var PackedModule; s: PSym) {.
    ...raises: [], tags: [].}
  Source   Edit
proc debug(tree: PackedTree; m: PackedModule) {....raises: [IOError],
    tags: [WriteIOEffect].}
  Source   Edit
proc idgenFromLoadedModule(m: LoadedModule): IdGenerator {....raises: [], tags: [].}
  Source   Edit
proc initEncoder(c: var PackedEncoder; m: var PackedModule; moduleSym: PSym;
                 config: ConfigRef; pc: PackedConfig) {....raises: [IOError],
    tags: [ReadIOEffect].}
setup a context for serializing to packed ast   Source   Edit
proc initPackedDecoder(config: ConfigRef; cache: IdentCache): PackedDecoder {.
    ...raises: [], tags: [].}
  Source   Edit
proc initRodIter(it: var RodIter; config: ConfigRef; cache: IdentCache;
                 g: var PackedModuleGraph; module: FileIndex; name: PIdent;
                 importHidden: bool): PSym {....raises: [KeyError, Exception],
    tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc initRodIterAllSyms(it: var RodIter; config: ConfigRef; cache: IdentCache;
                        g: var PackedModuleGraph; module: FileIndex;
                        importHidden: bool): PSym {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc interfaceSymbol(config: ConfigRef; cache: IdentCache;
                     g: var PackedModuleGraph; module: FileIndex; name: PIdent;
                     importHidden: bool): PSym {....raises: [KeyError, Exception],
    tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc isActive(e: PackedEncoder): bool {....raises: [], tags: [].}
  Source   Edit
proc loadNodes(c: var PackedDecoder; g: var PackedModuleGraph; thisModule: int;
               tree: PackedTree; n: NodePos): PNode {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc loadProcBody(config: ConfigRef; cache: IdentCache;
                  g: var PackedModuleGraph; s: PSym): PNode {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc loadRodFile(filename: AbsoluteFile; m: var PackedModule; config: ConfigRef;
                 ignoreConfig = false): RodFileError {.
    ...raises: [IOError, KeyError, Exception],
    tags: [ReadIOEffect, ReadDirEffect, RootEffect].}
  Source   Edit
proc loadSymFromId(config: ConfigRef; cache: IdentCache;
                   g: var PackedModuleGraph; module: int; id: PackedItemId): PSym {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc loadTypeFromId(config: ConfigRef; cache: IdentCache;
                    g: var PackedModuleGraph; module: int; id: PackedItemId): PType {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc moduleFromRodFile(g: var PackedModuleGraph; conf: ConfigRef;
                       cache: IdentCache; fileIdx: FileIndex;
                       cachedModules: var seq[FileIndex]): PSym {....raises: [
    OSError, IOError, KeyError, Exception, ValueError, ERecoverableError], tags: [
    ReadEnvEffect, ReadIOEffect, WriteDirEffect, ReadDirEffect, RootEffect,
    WriteIOEffect].}
Returns 'nil' if the module needs to be recompiled.   Source   Edit
proc moduleIndex(c: var PackedDecoder; g: var PackedModuleGraph;
                 thisModule: int; s: PackedItemId): int32 {.inline,
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc nextRodIter(it: var RodIter; g: var PackedModuleGraph): PSym {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc rememberStartupConfig(dest: var PackedConfig; config: ConfigRef) {.
    ...raises: [], tags: [].}
  Source   Edit
proc rodViewer(rodfile: AbsoluteFile; config: ConfigRef; cache: IdentCache) {.
    ...raises: [IOError, KeyError, Exception],
    tags: [ReadIOEffect, ReadDirEffect, RootEffect].}
  Source   Edit
proc saveRodFile(filename: AbsoluteFile; encoder: var PackedEncoder;
                 m: var PackedModule) {....raises: [Exception, IOError, OSError], tags: [
    RootEffect, WriteIOEffect, WriteDirEffect].}
  Source   Edit
proc searchForCompilerproc(m: LoadedModule; name: string): int32 {....raises: [],
    tags: [].}
  Source   Edit
proc simulateLoadedModule(g: var PackedModuleGraph; conf: ConfigRef;
                          cache: IdentCache; moduleSym: PSym; m: PackedModule) {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc storeExpansion(c: var PackedEncoder; m: var PackedModule; info: TLineInfo;
                    s: PSym) {....raises: [], tags: [].}
  Source   Edit
proc storeInstantiation(c: var PackedEncoder; m: var PackedModule; s: PSym;
                        i: PInstantiation) {....raises: [], tags: [].}
  Source   Edit
proc storeSym(s: PSym; c: var PackedEncoder; m: var PackedModule): PackedItemId {.
    ...raises: [Exception], tags: [RootEffect].}
serialize a psym   Source   Edit
proc storeTypeInst(c: var PackedEncoder; m: var PackedModule; s: PSym;
                   inst: PType) {....raises: [], tags: [].}
  Source   Edit
proc toFileIndex(x: LitId; m: PackedModule; config: ConfigRef): FileIndex {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc toFileIndexCached(c: var PackedDecoder; g: PackedModuleGraph;
                       thisModule: int; f: LitId): FileIndex {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit
proc toPackedGeneratedProcDef(s: PSym; encoder: var PackedEncoder;
                              m: var PackedModule) {....raises: [], tags: [].}
Generic procs and generated =hook's need explicit top-level entries so that the code generator can work without having to special case these. These entries will also be useful for other tools and are the cleanest design I can come up with.   Source   Edit
proc toPackedNode(n: PNode; ir: var PackedTree; c: var PackedEncoder;
                  m: var PackedModule) {....raises: [], tags: [].}
serialize a node into the tree   Source   Edit
proc toPackedNodeTopLevel(n: PNode; encoder: var PackedEncoder;
                          m: var PackedModule) {....raises: [Exception],
    tags: [RootEffect].}
  Source   Edit
proc toString(tree: PackedTree; n: NodePos; m: PackedModule): string {.
    ...raises: [], tags: [].}
  Source   Edit
proc toString(tree: PackedTree; n: NodePos; m: PackedModule; nesting: int;
              result: var string) {....raises: [], tags: [].}
  Source   Edit
proc translateId(id: PackedItemId; g: PackedModuleGraph; thisModule: int;
                 config: ConfigRef): ItemId {....raises: [KeyError, Exception],
    tags: [ReadDirEffect, RootEffect].}
  Source   Edit

Iterators

iterator interfaceSymbols(config: ConfigRef; cache: IdentCache;
                          g: var PackedModuleGraph; module: FileIndex;
                          name: PIdent; importHidden: bool): PSym {.
    ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
  Source   Edit