big compiler refactoring; avoid globals for multi method dispatcher generation
This commit is contained in:
parent
311253ef2f
commit
46efaf294b
29 changed files with 225 additions and 215 deletions
|
|
@ -2237,13 +2237,13 @@ proc myProcess(b: PPassContext, n: PNode): PNode =
|
|||
add(p.g.code, p.body)
|
||||
globals.unique = p.unique
|
||||
|
||||
proc wholeCode*(m: BModule): Rope =
|
||||
proc wholeCode(graph: ModuleGraph; m: BModule): Rope =
|
||||
for prc in globals.forwarded:
|
||||
if not globals.generatedSyms.containsOrIncl(prc.id):
|
||||
var p = newProc(globals, m, nil, m.module.options)
|
||||
attachProc(p, prc)
|
||||
|
||||
var disp = generateMethodDispatchers()
|
||||
var disp = generateMethodDispatchers(graph)
|
||||
for i in 0..sonsLen(disp)-1:
|
||||
let prc = disp.sons[i].sym
|
||||
if not globals.generatedSyms.containsOrIncl(prc.id):
|
||||
|
|
@ -2277,7 +2277,7 @@ proc genClass(obj: PType; content: Rope; ext: string) =
|
|||
let outfile = changeFileExt(completeCFilePath($cls), ext)
|
||||
discard writeRopeIfNotEqual(result, outfile)
|
||||
|
||||
proc myClose(b: PPassContext, n: PNode): PNode =
|
||||
proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode =
|
||||
if passes.skipCodegen(n): return n
|
||||
result = myProcess(b, n)
|
||||
var m = BModule(b)
|
||||
|
|
@ -2285,7 +2285,7 @@ proc myClose(b: PPassContext, n: PNode): PNode =
|
|||
let ext = if m.target == targetJS: "js" else: "php"
|
||||
let f = if globals.classes.len == 0: m.module.filename
|
||||
else: "nimsystem"
|
||||
let code = wholeCode(m)
|
||||
let code = wholeCode(graph, m)
|
||||
let outfile =
|
||||
if options.outFile.len > 0:
|
||||
if options.outFile.isAbsolute: options.outFile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue