rewrote lambdalifting; fixes deeply nested closures

This commit is contained in:
Araq 2014-06-26 15:58:41 +02:00
commit eed443d4b3
15 changed files with 458 additions and 298 deletions

View file

@ -417,6 +417,7 @@ type
# efficiency
nfTransf, # node has been transformed
nfSem # node has been checked for semantics
nfLL # node has gone through lambda lifting
nfDotField # the call can use a dot operator
nfDotSetter # the call can use a setter dot operarator
nfExplicitCall # x.y() was used instead of x.y
@ -1504,7 +1505,7 @@ proc isGenericRoutine*(s: PSym): bool =
proc skipGenericOwner*(s: PSym): PSym =
internalAssert s.kind in skProcKinds
## Generic instantiations are owned by their originating generic
## symbol. This proc skips such owners and goes straigh to the owner
## symbol. This proc skips such owners and goes straight to the owner
## of the generic itself (the module or the enclosing proc).
result = if sfFromGeneric in s.flags: s.owner.owner
else: s.owner