mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
more tests work
This commit is contained in:
@@ -43,7 +43,12 @@ proc idOrSig(m: BModule; s: PSym): Rope =
|
||||
# signatures for exported routines are reliable enough to
|
||||
# produce a unique name and this means produced C++ is more stable wrt
|
||||
# Nim changes:
|
||||
result = rope($hashProc(s))
|
||||
let sig = hashProc(s)
|
||||
result = rope($sig)
|
||||
let counter = m.sigConflicts.getOrDefault(sig)
|
||||
if counter != 0:
|
||||
result.add "_" & rope counter
|
||||
m.sigConflicts.inc(sig)
|
||||
else:
|
||||
result = "_" & rope s.id
|
||||
|
||||
|
||||
@@ -1099,6 +1099,7 @@ proc rawNewModule(module: PSym, filename: string): BModule =
|
||||
result.forwTypeCache = initTable[SigHash, Rope]()
|
||||
result.module = module
|
||||
result.typeInfoMarker = initTable[SigHash, Rope]()
|
||||
result.sigConflicts = initCountTable[SigHash]()
|
||||
result.initProc = newProc(nil, result)
|
||||
result.initProc.options = initProcOptions(result)
|
||||
result.preInitProc = newPreInitProc(result)
|
||||
|
||||
@@ -130,6 +130,7 @@ type
|
||||
extensionLoaders*: array['0'..'9', Rope] # special procs for the
|
||||
# OpenGL wrapper
|
||||
injectStmt*: Rope
|
||||
sigConflicts*: CountTable[SigHash]
|
||||
|
||||
var
|
||||
mainModProcs*, mainModInit*, otherModsInit*, mainDatInit*: Rope
|
||||
|
||||
@@ -557,7 +557,10 @@ proc typeBorrow(sym: PSym, n: PNode) =
|
||||
incl(sym.typ.flags, tfBorrowDot)
|
||||
|
||||
proc markCompilerProc(s: PSym) =
|
||||
makeExternExport(s, "$1", s.info)
|
||||
# minor hack ahead: FlowVar is the only generic .compilerProc type which
|
||||
# should not have an external name set:
|
||||
if s.kind != skType or s.name.s != "FlowVar":
|
||||
makeExternExport(s, "$1", s.info)
|
||||
incl(s.flags, sfCompilerProc)
|
||||
incl(s.flags, sfUsed)
|
||||
registerCompilerProc(s)
|
||||
|
||||
@@ -250,7 +250,7 @@ proc hashProc*(s: PSym): SigHash =
|
||||
# so that createThread[void]() (aka generic specialization) gets a unique
|
||||
# hash, we also hash the line information. This is pretty bad, but the best
|
||||
# solution for now:
|
||||
c &= s.info.line
|
||||
#c &= s.info.line
|
||||
md5Final c, result.Md5Digest
|
||||
|
||||
proc hashOwner*(s: PSym): SigHash =
|
||||
|
||||
Reference in New Issue
Block a user