summary refs log tree commit diff stats
path: root/compiler/idgen.nim
diff options
context:
space:
mode:
authorYuriy Glukhov <yuriy.glukhov@gmail.com>2018-05-15 19:54:52 +0300
committerYuriy Glukhov <yuriy.glukhov@gmail.com>2018-05-15 19:54:52 +0300
commitcfe40a3e6e920ed0c105af0012af739794c10b55 (patch)
treee823d767192acd7a3988f963633eaaa7a39cb4b3 /compiler/idgen.nim
parent5d166fcc0ae1ab203f965f0650fd4834542a46f6 (diff)
parent02f01470ab46067c18535605179b95b143b1e25f (diff)
downloadNim-cfe40a3e6e920ed0c105af0012af739794c10b55.tar.gz
Merge branch 'devel' into yield-in-try
Diffstat (limited to 'compiler/idgen.nim')
-rw-r--r--compiler/idgen.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/idgen.nim b/compiler/idgen.nim
index c6b1a4d07..7d103ffd7 100644
--- a/compiler/idgen.nim
+++ b/compiler/idgen.nim
@@ -36,20 +36,20 @@ proc setId*(id: int) {.inline.} =
 proc idSynchronizationPoint*(idRange: int) =
   gFrontEndId = (gFrontEndId div idRange + 1) * idRange + 1
 
-proc toGid(f: string): string =
+proc toGid(conf: ConfigRef; f: string): string =
   # we used to use ``f.addFileExt("gid")`` (aka ``$project.gid``), but this
   # will cause strange bugs if multiple projects are in the same folder, so
   # we simply use a project independent name:
-  result = options.completeGeneratedFilePath("nim.gid")
+  result = options.completeGeneratedFilePath(conf, "nim.gid")
 
-proc saveMaxIds*(project: string) =
-  var f = open(project.toGid, fmWrite)
+proc saveMaxIds*(conf: ConfigRef; project: string) =
+  var f = open(toGid(conf, project), fmWrite)
   f.writeLine($gFrontEndId)
   f.close()
 
-proc loadMaxIds*(project: string) =
+proc loadMaxIds*(conf: ConfigRef; project: string) =
   var f: File
-  if open(f, project.toGid, fmRead):
+  if open(f, toGid(conf, project), fmRead):
     var line = newStringOfCap(20)
     if f.readLine(line):
       var frontEndId = parseInt(line)