diff options
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r-- | compiler/cgen.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 5c60a3cf3..f0120c435 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -996,9 +996,9 @@ proc genProcAux(m: BModule, prc: PSym) = var returnStmt: Rope = nil assert(prc.ast != nil) - var procBody = transformBody(m.g.graph, prc, cache = false) + var procBody = transformBody(m.g.graph, m.idgen, prc, cache = false) if sfInjectDestructors in prc.flags: - procBody = injectDestructorCalls(m.g.graph, prc, procBody) + procBody = injectDestructorCalls(m.g.graph, m.idgen, prc, procBody) if sfPure notin prc.flags and prc.typ[0] != nil: if resultPos >= prc.ast.len: @@ -1844,9 +1844,10 @@ template injectG() {.dirty.} = when not defined(nimHasSinkInference): {.pragma: nosinks.} -proc myOpen(graph: ModuleGraph; module: PSym): PPassContext {.nosinks.} = +proc myOpen(graph: ModuleGraph; module: PSym; idgen: IdGenerator): PPassContext {.nosinks.} = injectG() result = newModule(g, module, graph.config) + result.idgen = idgen if optGenIndex in graph.config.globalOptions and g.generatedHeader == nil: let f = if graph.config.headerFile.len > 0: AbsoluteFile graph.config.headerFile else: graph.config.projectFull @@ -1920,9 +1921,9 @@ proc myProcess(b: PPassContext, n: PNode): PNode = m.initProc.options = initProcOptions(m) #softRnl = if optLineDir in m.config.options: noRnl else: rnl # XXX replicate this logic! - var transformedN = transformStmt(m.g.graph, m.module, n) + var transformedN = transformStmt(m.g.graph, m.idgen, m.module, n) if sfInjectDestructors in m.module.flags: - transformedN = injectDestructorCalls(m.g.graph, m.module, transformedN) + transformedN = injectDestructorCalls(m.g.graph, m.idgen, m.module, transformedN) if m.hcrOn: addHcrInitGuards(m.initProc, transformedN, m.inHcrInitGuard) |