rod.nim 983 B

123456789101112131415161718192021222324252627282930
  1. #
  2. #
  3. # The Nim Compiler
  4. # (c) Copyright 2017 Andreas Rumpf
  5. #
  6. # See the file "copying.txt", included in this
  7. # distribution, for details about the copyright.
  8. #
  9. ## This module implements the canonalization for the various caching mechanisms.
  10. import ast, idgen, lineinfos, msgs, incremental, modulegraphs, pathutils
  11. when not nimIncremental:
  12. template setupModuleCache*(g: ModuleGraph) = discard
  13. template storeNode*(g: ModuleGraph; module: PSym; n: PNode) = discard
  14. template loadNode*(g: ModuleGraph; module: PSym): PNode = newNode(nkStmtList)
  15. template getModuleId*(g: ModuleGraph; fileIdx: FileIndex; fullpath: AbsoluteFile): int = getID()
  16. template addModuleDep*(g: ModuleGraph; module, fileIdx: FileIndex; isIncludeFile: bool) = discard
  17. template storeRemaining*(g: ModuleGraph; module: PSym) = discard
  18. else:
  19. include rodimpl
  20. # idea for testing all this logic: *Always* load the AST from the DB, whether
  21. # we already have it in RAM or not!