VM now supports lambda lifting

This commit is contained in:
Araq 2013-11-06 08:37:20 +01:00
commit 27ec76dd3a
6 changed files with 71 additions and 29 deletions

View file

@ -735,12 +735,9 @@ proc transformBody*(module: PSym, n: PNode, prc: PSym): PNode =
if nfTransf in n.flags or prc.kind in {skTemplate}:
result = n
else:
#when useEffectSystem: trackProc(prc, n)
var c = openTransf(module, "")
result = processTransf(c, n, prc)
if prc.kind != skMacro:
# XXX no closures yet for macros:
result = liftLambdas(prc, result)
result = liftLambdas(prc, result)
if prc.kind == skIterator and prc.typ.callConv == ccClosure:
result = lambdalifting.liftIterator(prc, result)
incl(result.flags, nfTransf)