diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-30 10:15:41 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-30 10:15:41 +0200 |
commit | ddc6cec69e66f4cc28275f61b73962042e257575 (patch) | |
tree | 6b7752efde22f3a1bac23b083eb5e8e27f9a8a35 /compiler/rod.nim | |
parent | 688c54d8f158ff977161a234374b1cd321ba95f3 (diff) | |
download | Nim-ddc6cec69e66f4cc28275f61b73962042e257575.tar.gz |
refactoring: move DB model to incremental.nim
Diffstat (limited to 'compiler/rod.nim')
-rw-r--r-- | compiler/rod.nim | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/rod.nim b/compiler/rod.nim index 82f556b3b..1b5331ba7 100644 --- a/compiler/rod.nim +++ b/compiler/rod.nim @@ -9,18 +9,21 @@ ## This module implements the canonalization for the various caching mechanisms. -import ast, idgen, lineinfos, msgs +import ast, idgen, lineinfos, msgs, incremental, modulegraphs -when not defined(nimSymbolfiles): - template setupModuleCache* = discard - template storeNode*(module: PSym; n: PNode) = discard - template loadNode*(module: PSym; index: var int): PNode = PNode(nil) +when not nimIncremental: + template setupModuleCache*(g: ModuleGraph) = discard + template storeNode*(g: ModuleGraph; module: PSym; n: PNode) = discard + template loadNode*(g: ModuleGraph; module: PSym; index: var int): PNode = PNode(nil) - template getModuleId*(fileIdx: FileIndex; fullpath: string): int = getID() + template getModuleId*(g: ModuleGraph; fileIdx: FileIndex; fullpath: string): int = getID() - template addModuleDep*(module, fileIdx: FileIndex; isIncludeFile: bool) = discard + template addModuleDep*(g: ModuleGraph; module, fileIdx: FileIndex; isIncludeFile: bool) = discard - template storeRemaining*(module: PSym) = discard + template storeRemaining*(g: ModuleGraph; module: PSym) = discard else: include rodimpl + + # idea for testing all this logic: *Always* load the AST from the DB, whether + # we already have it in RAM or not! |