diff options
Diffstat (limited to 'compiler/ic/cbackend.nim')
-rw-r--r-- | compiler/ic/cbackend.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/ic/cbackend.nim b/compiler/ic/cbackend.nim index 815078a36..83f1b4cc7 100644 --- a/compiler/ic/cbackend.nim +++ b/compiler/ic/cbackend.nim @@ -18,7 +18,7 @@ ## also doing cross-module dependency tracking and DCE that we don't need ## anymore. DCE is now done as prepass over the entire packed module graph. -import std/packedsets, algorithm, tables +import std/[packedsets, algorithm, tables] when defined(nimPreviewSlimSystem): import std/assertions @@ -51,6 +51,8 @@ proc generateCodeForModule(g: ModuleGraph; m: var LoadedModule; alive: var Alive cgen.genTopLevelStmt(bmod, n) finalCodegenActions(g, bmod, newNodeI(nkStmtList, m.module.info)) + for disp in getDispatchers(g): + genProcAux(bmod, disp) m.fromDisk.backendFlags = cgen.whichInitProcs(bmod) proc replayTypeInfo(g: ModuleGraph; m: var LoadedModule; origin: FileIndex) = @@ -98,7 +100,7 @@ proc aliveSymsChanged(config: ConfigRef; position: int; alive: AliveSyms): bool var f2 = rodfiles.open(asymFile.string) f2.loadHeader() f2.loadSection aliveSymsSection - var oldData: seq[int32] + var oldData: seq[int32] = @[] f2.loadSeq(oldData) f2.close if f2.err == ok and oldData == s: @@ -144,12 +146,12 @@ proc generateCode*(g: ModuleGraph) = var alive = computeAliveSyms(g.packed, g.config) when false: - for i in 0..high(g.packed): + for i in 0..<len(g.packed): echo i, " is of status ", g.packed[i].status, " ", toFullPath(g.config, FileIndex(i)) # First pass: Setup all the backend modules for all the modules that have # changed: - for i in 0..high(g.packed): + for i in 0..<len(g.packed): # case statement here to enforce exhaustive checks. case g.packed[i].status of undefined: @@ -171,7 +173,7 @@ proc generateCode*(g: ModuleGraph) = let mainModuleIdx = g.config.projectMainIdx2.int # We need to generate the main module last, because only then # all init procs have been registered: - for i in 0..high(g.packed): + for i in 0..<len(g.packed): if i != mainModuleIdx: genPackedModule(g, i, alive) if mainModuleIdx >= 0: |