summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-02-09 08:18:33 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-09 08:18:33 +0100
commit3c909ae8ff27048f5ba04023dd620a10b05428a7 (patch)
tree83949604aa69bf2dcede696eb90ea248f6d785f2 /compiler
parentc4ad29754450769b82ea8b5751b1ef995f0f87fd (diff)
downloadNim-3c909ae8ff27048f5ba04023dd620a10b05428a7.tar.gz
fixes #10606
Diffstat (limited to 'compiler')
-rw-r--r--compiler/passes.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/passes.nim b/compiler/passes.nim
index 50fc13e1e..f45ee03f7 100644
--- a/compiler/passes.nim
+++ b/compiler/passes.nim
@@ -167,7 +167,9 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
         if graph.stopCompile(): break
         var n = parseTopLevelStmt(p)
         if n.kind == nkEmpty: break
-        if {sfNoForward, sfReorder} * module.flags != {}:
+        if sfSystemModule notin module.flags and
+            ({sfNoForward, sfReorder} * module.flags != {} or
+            codeReordering in graph.config.features):
           # read everything, no streaming possible
           var sl = newNodeI(nkStmtList, n.info)
           sl.add n
@@ -175,7 +177,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
             var n = parseTopLevelStmt(p)
             if n.kind == nkEmpty: break
             sl.add n
-          if sfReorder in module.flags:
+          if sfReorder in module.flags or codeReordering in graph.config.features:
             sl = reorder(graph, sl, module)
           discard processTopLevelStmt(graph, sl, a)
           break