IR: minor refactoring
This commit is contained in:
parent
f58d87cb43
commit
ceb1a1b688
1 changed files with 4 additions and 1 deletions
|
|
@ -120,6 +120,9 @@ proc prepareConfigNotes(graph: ModuleGraph; module: PSym) =
|
||||||
if graph.config.mainPackageNotes == {}: graph.config.mainPackageNotes = graph.config.notes
|
if graph.config.mainPackageNotes == {}: graph.config.mainPackageNotes = graph.config.notes
|
||||||
graph.config.notes = graph.config.foreignPackageNotes
|
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.} =
|
proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {.discardable.} =
|
||||||
if graph.stopCompile(): return true
|
if graph.stopCompile(): return true
|
||||||
var
|
var
|
||||||
|
|
@ -128,7 +131,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool {
|
||||||
s: PLLStream
|
s: PLLStream
|
||||||
fileIdx = module.fileIdx
|
fileIdx = module.fileIdx
|
||||||
prepareConfigNotes(graph, module)
|
prepareConfigNotes(graph, module)
|
||||||
if module.id < 0:
|
if not moduleHasChanged(graph, module):
|
||||||
# new module caching mechanism:
|
# new module caching mechanism:
|
||||||
for i in 0 ..< graph.passes.len:
|
for i in 0 ..< graph.passes.len:
|
||||||
if not isNil(graph.passes[i].open) and not graph.passes[i].isFrontend:
|
if not isNil(graph.passes[i].open) and not graph.passes[i].isFrontend:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue