Speed-up symbolFiles:on operations on windows
This commit is contained in:
parent
24e1d22ec9
commit
2f95e4d829
2 changed files with 12 additions and 14 deletions
|
|
@ -15,7 +15,8 @@ import
|
||||||
os, lists, condsyms, rodread, rodwrite, ropes, trees,
|
os, lists, condsyms, rodread, rodwrite, ropes, trees,
|
||||||
wordrecg, sem, semdata, idents, passes, docgen, extccomp,
|
wordrecg, sem, semdata, idents, passes, docgen, extccomp,
|
||||||
cgen, ecmasgen,
|
cgen, ecmasgen,
|
||||||
platform, nimconf, importer, passaux, depends, transf, evals, types, idgen
|
platform, nimconf, importer, passaux, depends, transf, evals, types, idgen,
|
||||||
|
tables
|
||||||
|
|
||||||
const
|
const
|
||||||
has_LLVM_Backend = false
|
has_LLVM_Backend = false
|
||||||
|
|
@ -27,19 +28,16 @@ proc MainCommand*()
|
||||||
|
|
||||||
# ------------------ module handling -----------------------------------------
|
# ------------------ module handling -----------------------------------------
|
||||||
|
|
||||||
type
|
var
|
||||||
TFileModuleRec = tuple[filename: string, module: PSym]
|
compMods = initTable[string, PSym]() # all compiled modules
|
||||||
TFileModuleMap = seq[TFileModuleRec]
|
|
||||||
|
|
||||||
var compMods: TFileModuleMap = @[] # all compiled modules
|
|
||||||
|
|
||||||
|
# This expects a normalized module path
|
||||||
proc registerModule(filename: string, module: PSym) =
|
proc registerModule(filename: string, module: PSym) =
|
||||||
compMods.add((filename, module))
|
compMods[filename] = module
|
||||||
|
|
||||||
|
# This expects a normalized module path
|
||||||
proc getModule(filename: string): PSym =
|
proc getModule(filename: string): PSym =
|
||||||
for i in countup(0, high(compMods)):
|
result = compMods[filename]
|
||||||
if sameFile(compMods[i].filename, filename):
|
|
||||||
return compMods[i].module
|
|
||||||
|
|
||||||
proc newModule(filename: string): PSym =
|
proc newModule(filename: string): PSym =
|
||||||
# We cannot call ``newSym`` here, because we have to circumvent the ID
|
# We cannot call ``newSym`` here, because we have to circumvent the ID
|
||||||
|
|
|
||||||
|
|
@ -788,7 +788,7 @@ proc loadMethods(r: PRodReader) =
|
||||||
|
|
||||||
proc getModuleIdx(filename: string): int =
|
proc getModuleIdx(filename: string): int =
|
||||||
for i in countup(0, high(gMods)):
|
for i in countup(0, high(gMods)):
|
||||||
if sameFile(gMods[i].filename, filename): return i
|
if gMods[i].filename == filename: return i
|
||||||
result = len(gMods)
|
result = len(gMods)
|
||||||
setlen(gMods, result + 1)
|
setlen(gMods, result + 1)
|
||||||
|
|
||||||
|
|
@ -853,7 +853,7 @@ proc handleSymbolFile(module: PSym, filename: string): PRodReader =
|
||||||
|
|
||||||
proc GetCRC*(filename: string): TCrc32 =
|
proc GetCRC*(filename: string): TCrc32 =
|
||||||
for i in countup(0, high(gMods)):
|
for i in countup(0, high(gMods)):
|
||||||
if sameFile(gMods[i].filename, filename): return gMods[i].crc
|
if gMods[i].filename == filename: return gMods[i].crc
|
||||||
|
|
||||||
result = crcFromFile(filename)
|
result = crcFromFile(filename)
|
||||||
#var idx = getModuleIdx(filename)
|
#var idx = getModuleIdx(filename)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue