compilation cache: various bugfixes; works for the compiler itself

This commit is contained in:
Araq 2011-10-27 00:41:42 +02:00
commit 90db9171a2
13 changed files with 307 additions and 148 deletions

View file

@ -56,16 +56,17 @@ proc SearchForProc(c: PContext, fn: PSym, tos: int): PSym =
nil
result = NextIdentIter(it, c.tab.stack[tos])
proc paramsFitBorrow(a, b: PNode): bool =
var length = sonsLen(a)
proc paramsFitBorrow(child, parent: PNode): bool =
var length = sonsLen(child)
result = false
if length == sonsLen(b):
if length == sonsLen(parent):
for i in countup(1, length - 1):
var m = a.sons[i].sym
var n = b.sons[i].sym
var m = child.sons[i].sym
var n = parent.sons[i].sym
assert((m.kind == skParam) and (n.kind == skParam))
if not equalOrDistinctOf(m.typ, n.typ): return
if not equalOrDistinctOf(a.sons[0].typ, b.sons[0].typ): return
if not compareTypes(m.typ, n.typ, dcEqOrDistinctOf): return
if not compareTypes(child.sons[0].typ, parent.sons[0].typ,
dcEqOrDistinctOf): return
result = true
proc SearchForBorrowProc(c: PContext, fn: PSym, tos: int): PSym =