avoid AST streaming, experiment what it breaks

This commit is contained in:
Araq 2018-07-09 13:07:55 +02:00
commit 470949f2e0

View file

@ -179,7 +179,11 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
if graph.stopCompile(): break if graph.stopCompile(): break
var n = parseTopLevelStmt(p) var n = parseTopLevelStmt(p)
if n.kind == nkEmpty: break if n.kind == nkEmpty: break
if {sfNoForward, sfReorder} * module.flags != {}: #if {sfNoForward, sfReorder} * module.flags != {}:
when true:
# we now process the full AST in one go, so that destructor injection for top
# level statements works correctly.
if graph.stopCompile(): break
# read everything, no streaming possible # read everything, no streaming possible
var sl = newNodeI(nkStmtList, n.info) var sl = newNodeI(nkStmtList, n.info)
sl.add n sl.add n
@ -191,7 +195,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
sl = reorder(graph, sl, module) sl = reorder(graph, sl, module)
discard processTopLevelStmt(sl, a) discard processTopLevelStmt(sl, a)
break break
elif not processTopLevelStmt(n, a): break #elif not processTopLevelStmt(n, a): break
closeParsers(p) closeParsers(p)
if s.kind != llsStdIn: break if s.kind != llsStdIn: break
closePasses(graph, a) closePasses(graph, a)