removed nimdat in favor of per-module dat init procs

This commit is contained in:
Zahary Karadjov 2012-07-19 19:04:18 +03:00
commit 4841b6390c
6 changed files with 73 additions and 75 deletions

View file

@ -39,6 +39,7 @@ proc registerModule(filename: string, module: PSym) =
proc getModule(filename: string): PSym =
result = compMods[filename]
var gModulesCount = 0
proc newModule(filename: string): PSym =
# We cannot call ``newSym`` here, because we have to circumvent the ID
# mechanism, which we do in order to assign each module a persistent ID.
@ -51,6 +52,8 @@ proc newModule(filename: string): PSym =
result.owner = result # a module belongs to itself
result.info = newLineInfo(filename, 1, 1)
result.position = gModulesCount
inc gModulesCount
incl(result.flags, sfUsed)
initStrTable(result.tab)
RegisterModule(filename, result)