summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-07-27 10:23:14 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-07-27 14:01:28 +0200
commitceb1a1b6884b28f3f3f88a4be5663d7f0b1f1155 (patch)
tree62bd95dfc772bda027c18bd3e29b93b5f734529c /compiler
parentf58d87cb43a7ddb35bc60b73ecf758842decb1a2 (diff)
downloadNim-ceb1a1b6884b28f3f3f88a4be5663d7f0b1f1155.tar.gz
IR: minor refactoring
Diffstat (limited to 'compiler')
-rw-r--r--compiler/passes.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/passes.nim b/compiler/passes.nim
index 82314b789..e917c1ce4 100644
--- a/compiler/passes.nim
+++ b/compiler/passes.nim
@@ -120,6 +120,9 @@ proc prepareConfigNotes(graph: ModuleGraph; module: PSym) =
     if graph.config.mainPackageNotes == {}: graph.config.mainPackageNotes = graph.config.notes
     graph.config.notes = graph.config.foreignPackageNotes
 
+proc moduleHasChanged*(graph: ModuleGraph; module: PSym): bool {.inline.} =
+  result = module.id >= 0
+
 proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {.discardable.} =
   if graph.stopCompile(): return true
   var
@@ -128,7 +131,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
     s: PLLStream
     fileIdx = module.fileIdx
   prepareConfigNotes(graph, module)
-  if module.id < 0:
+  if not moduleHasChanged(graph, module):
     # new module caching mechanism:
     for i in 0 ..< graph.passes.len:
       if not isNil(graph.passes[i].open) and not graph.passes[i].isFrontend: