summary refs log tree commit diff stats
path: root/compiler/rodread.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-04-08 00:10:53 +0200
committerAraq <rumpf_a@web.de>2013-04-08 00:10:53 +0200
commitfb3cda551a46753526bbffd38049d93a5df08a72 (patch)
tree9745f91fb67517b3b7bdd7a057aff69d40ebf46f /compiler/rodread.nim
parentbb3f648bd2d9b01da86ae73b491eabaaa72b7cca (diff)
parent27dd39778f49f5bb800d80e2ed8475edf41837f8 (diff)
downloadNim-fb3cda551a46753526bbffd38049d93a5df08a72.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'compiler/rodread.nim')
-rw-r--r--compiler/rodread.nim23
1 files changed, 12 insertions, 11 deletions
diff --git a/compiler/rodread.nim b/compiler/rodread.nim
index 84ef0e1fe..d5eede8a4 100644
--- a/compiler/rodread.nim
+++ b/compiler/rodread.nim
@@ -126,8 +126,8 @@ type
     s: cstring               # mmap'ed file contents
     options: TOptions
     reason: TReasonForRecompile
-    modDeps: TStringSeq
-    files: TStringSeq
+    modDeps: seq[int32]
+    files: seq[int32]
     dataIdx: int             # offset of start of data section
     convertersIdx: int       # offset of start of converters section
     initIdx, interfIdx, compilerProcsIdx, methodsIdx: int
@@ -586,9 +586,10 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
       inc(r.pos, 2)           # skip "(\10"
       inc(r.line)
       while r.s[r.pos] != ')':
-        var relativePath = decodeStr(r.s, r.pos)
-        var resolvedPath = relativePath.findModule
-        r.files.add(if resolvedPath.len > 0: resolvedPath else: relativePath)
+        let relativePath = decodeStr(r.s, r.pos)
+        let resolvedPath = relativePath.findModule
+        let finalPath = if resolvedPath.len > 0: resolvedPath else: relativePath
+        r.files.add(finalPath.fileInfoIdx)
         inc(r.pos)            # skip #10
         inc(r.line)
       if r.s[r.pos] == ')': inc(r.pos)
@@ -596,7 +597,7 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
       inc(r.pos, 2)           # skip "(\10"
       inc(r.line)
       while r.s[r.pos] != ')': 
-        w = r.files[decodeVInt(r.s, r.pos)]
+        w = r.files[decodeVInt(r.s, r.pos)].toFullPath
         inc(r.pos)            # skip ' '
         inclCrc = decodeVInt(r.s, r.pos)
         if r.reason == rrNone: 
@@ -827,8 +828,8 @@ proc checkDep(fileIdx: int32): TReasonForRecompile =
       # this, since results are cached.
       var res = checkDep(SystemFileIdx)
       if res != rrNone: result = rrModDeps
-      for i in countup(0, high(r.modDeps)): 
-        res = checkDep(r.modDeps[i].fileInfoIdx)
+      for i in countup(0, high(r.modDeps)):
+        res = checkDep(r.modDeps[i])
         if res != rrNone:
           result = rrModDeps
           # we cannot break here, because of side-effects of `checkDep`
@@ -1062,11 +1063,11 @@ proc viewFile(rodfile: string) =
       while r.s[r.pos] != ')':
         let relativePath = decodeStr(r.s, r.pos)
         let resolvedPath = relativePath.findModule
-        let rr = if resolvedPath.len > 0: resolvedPath else: relativePath
-        r.files.add(rr)
+        let finalPath = if resolvedPath.len > 0: resolvedPath else: relativePath
+        r.files.add(finalPath.fileInfoIdx)
         inc(r.pos)            # skip #10
         inc(r.line)
-        outf.writeln(rr)
+        outf.writeln finalPath
       if r.s[r.pos] == ')': inc(r.pos)
       outf.write(")\n")
     of "INCLUDES":