diff options
author | Dominik Picheta <dominikpicheta@gmail.com> | 2015-10-27 23:36:00 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@gmail.com> | 2015-10-27 23:36:00 +0100 |
commit | 3892969af4a3c6f509b553f07b2a7f37aa8de967 (patch) | |
tree | f4ac158a72b3f520848a479ee4faa8dd68792738 /compiler/idgen.nim | |
parent | c7eaa8ae034fc22fcb91770f94e08f7c1ebb9963 (diff) | |
parent | d9415fd5cebdc44385cdd092f2c49060c09e2631 (diff) | |
download | Nim-3892969af4a3c6f509b553f07b2a7f37aa8de967.tar.gz |
Merge branch 'devel'
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): |