lowerings

This module implements common simple lowerings.

Consts

genPrefix = ":tmp"
  Source Edit

Procs

proc newDeref(n: PNode): PNode {...}{.inline, raises: [], tags: [].}
  Source Edit
proc newTupleAccess(g: ModuleGraph; tup: PNode; i: int): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit
proc addVar(father, v: PNode) {...}{.raises: [], tags: [].}
  Source Edit
proc addVar(father, v, value: PNode) {...}{.raises: [], tags: [].}
  Source Edit
proc newAsgnStmt(le, ri: PNode): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc newFastAsgnStmt(le, ri: PNode): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc newFastMoveStmt(g: ModuleGraph; le, ri: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit
proc lowerTupleUnpacking(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit
proc evalOnce(g: ModuleGraph; value: PNode; owner: PSym): PNode {...}{.raises: [],
    tags: [].}
Turns (value) into (let tmp = value; tmp) so that 'value' can be re-used freely, multiple times. This is frequently required and such a builtin would also be handy to have in macros.nim. The value that can be reused is 'result.lastSon'!   Source Edit
proc newTupleAccessRaw(tup: PNode; i: int): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc newTryFinally(body, final: PNode): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc lowerTupleUnpackingForAsgn(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.
    raises: [], tags: [].}
  Source Edit
proc lowerSwap(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.raises: [],
    tags: [].}
  Source Edit
proc createObj(g: ModuleGraph; owner: PSym; info: TLineInfo; final = true): PType {...}{.
    raises: [], tags: [].}
  Source Edit
proc rawAddField(obj: PType; field: PSym) {...}{.raises: [], tags: [].}
  Source Edit
proc rawIndirectAccess(a: PNode; field: PSym; info: TLineInfo): PNode {...}{.
    raises: [], tags: [].}
  Source Edit
proc rawDirectAccess(obj, field: PSym): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc addField(obj: PType; s: PSym; cache: IdentCache) {...}{.raises: [], tags: [].}
  Source Edit
proc addUniqueField(obj: PType; s: PSym; cache: IdentCache): PSym {...}{.discardable,
    raises: [], tags: [].}
  Source Edit
proc newDotExpr(obj, b: PSym): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc indirectAccess(a: PNode; b: int; info: TLineInfo): PNode {...}{.raises: [],
    tags: [].}
  Source Edit
proc indirectAccess(a: PNode; b: string; info: TLineInfo; cache: IdentCache): PNode {...}{.
    raises: [], tags: [].}
  Source Edit
proc getFieldFromObj(t: PType; v: PSym): PSym {...}{.raises: [], tags: [].}
  Source Edit
proc indirectAccess(a: PNode; b: PSym; info: TLineInfo): PNode {...}{.raises: [],
    tags: [].}
  Source Edit
proc indirectAccess(a, b: PSym; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc genAddrOf(n: PNode; typeKind = tyPtr): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc genDeref(n: PNode; k = nkHiddenDeref): PNode {...}{.raises: [], tags: [].}
  Source Edit
proc callCodegenProc(g: ModuleGraph; name: string;
                     info: TLineInfo = unknownLineInfo;
                     arg1, arg2, arg3, optionalArgs: PNode = nil): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit
proc newIntLit(g: ModuleGraph; info: TLineInfo; value: BiggestInt): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit
proc genHigh(g: ModuleGraph; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit
proc genLen(g: ModuleGraph; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
  Source Edit