mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-09 06:23:25 +00:00
next steps to make symbol files work again
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user