big compiler refactoring; avoid globals for multi method dispatcher generation

This commit is contained in:
Andreas Rumpf 2017-02-22 16:27:52 +01:00
commit 46efaf294b
29 changed files with 225 additions and 215 deletions

View file

@ -1366,7 +1366,7 @@ proc updateCachedModule(m: BModule) =
cf.flags = {CfileFlag.Cached}
addFileToCompile(cf)
proc myClose(b: PPassContext, n: PNode): PNode =
proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode =
result = n
if b == nil or passes.skipCodegen(n): return
var m = BModule(b)
@ -1378,7 +1378,7 @@ proc myClose(b: PPassContext, n: PNode): PNode =
if sfMainModule in m.module.flags:
incl m.flags, objHasKidsValid
var disp = generateMethodDispatchers()
var disp = generateMethodDispatchers(graph)
for i in 0..sonsLen(disp)-1: genProcAux(m, disp.sons[i].sym)
genMainProc(m)