remove any traces of the old global generics cache

This commit is contained in:
Zahary Karadjov 2013-01-27 21:28:34 +02:00
commit 55f8ed2452
6 changed files with 65 additions and 109 deletions

View file

@ -104,9 +104,9 @@ proc instantiateBody(c: PContext, n: PNode, result: PSym) =
popProcCon(c)
proc fixupInstantiatedSymbols(c: PContext, s: PSym) =
for i in countup(0, Len(c.generics.generics) - 1):
if c.generics.generics[i].genericSym.id == s.id:
var oldPrc = c.generics.generics[i].inst.sym
for i in countup(0, c.generics.len - 1):
if c.generics[i].genericSym.id == s.id:
var oldPrc = c.generics[i].inst.sym
pushInfoContext(oldPrc.info)
openScope(c.tab)
var n = oldPrc.ast
@ -166,7 +166,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
var oldPrc = GenericCacheGet(fn, entry[])
if oldPrc == nil:
fn.procInstCache.safeAdd(entry)
c.generics.generics.add(makeInstPair(fn, entry))
c.generics.add(makeInstPair(fn, entry))
if n.sons[pragmasPos].kind != nkEmpty:
pragma(c, result, n.sons[pragmasPos], allRoutinePragmas)
if isNil(n.sons[bodyPos]):