diff options
Diffstat (limited to 'compiler/idgen.nim')
-rw-r--r-- | compiler/idgen.nim | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/idgen.nim b/compiler/idgen.nim index 3c5669b54..c07782fb2 100644 --- a/compiler/idgen.nim +++ b/compiler/idgen.nim @@ -18,26 +18,26 @@ const when debugIds: import intsets - + var usedIds = initIntSet() -proc registerID*(id: PIdObj) = - when debugIds: - if id.id == -1 or containsOrIncl(usedIds, id.id): +proc registerID*(id: PIdObj) = + when debugIds: + if id.id == -1 or containsOrIncl(usedIds, id.id): internalError("ID already used: " & $id.id) -proc getID*(): int {.inline.} = +proc getID*(): int {.inline.} = result = gFrontEndId inc(gFrontEndId) -proc backendId*(): int {.inline.} = +proc backendId*(): int {.inline.} = result = gBackendId inc(gBackendId) -proc setId*(id: int) {.inline.} = +proc setId*(id: int) {.inline.} = gFrontEndId = max(gFrontEndId, id + 1) -proc idSynchronizationPoint*(idRange: int) = +proc idSynchronizationPoint*(idRange: int) = gFrontEndId = (gFrontEndId div idRange + 1) * idRange + 1 proc toGid(f: string): string = @@ -48,10 +48,10 @@ proc toGid(f: string): string = proc saveMaxIds*(project: string) = var f = open(project.toGid, fmWrite) - f.writeln($gFrontEndId) - f.writeln($gBackendId) + f.writeLine($gFrontEndId) + f.writeLine($gBackendId) f.close() - + proc loadMaxIds*(project: string) = var f: File if open(f, project.toGid, fmRead): |