next steps to make symbol files work again

This commit is contained in:
Araq
2013-04-08 14:27:55 +02:00
parent 00cdbca413
commit 6d64a6e42c
2 changed files with 10 additions and 3 deletions

View File

@@ -155,7 +155,8 @@ proc compileModule(fileIdx: int32, flags: TSymFlags): PSym =
growCache gMemCacheData, fileIdx
gMemCacheData[fileIdx].needsRecompile = Probing
result = newModule(fileIdx)
var rd = handleSymbolFile(result)
#var rd = handleSymbolFile(result)
var rd: PRodReader
result.flags = result.flags + flags
if gCmd in {cmdCompileToC, cmdCompileToCpp, cmdCheck, cmdIdeTools}:
rd = handleSymbolFile(result)

View File

@@ -729,8 +729,14 @@ proc findSomeWhere(id: int) =
echo "found id ", id, " in ", gMods[i].filename
proc getReader(moduleId: int): PRodReader =
InternalAssert moduleId >= 0 and moduleId < gMods.len
result = gMods[moduleId].rd
# we can't index 'gMods' here as it's indexed by a *file index* which is not
# the module ID! We could introduce a mapping ID->PRodReader but I'll leave
# this for later versions if benchmarking shows the linear search causes
# problems:
for i in 0 .. <gMods.len:
result = gMods[i].rd
if result != nil and result.moduleId == moduleId: return result
return nil
proc rrGetSym(r: PRodReader, id: int, info: TLineInfo): PSym =
result = PSym(IdTableGet(r.syms, id))