lazy loading of body ast implemented

This commit is contained in:
Araq 2011-10-30 20:53:04 +01:00
commit c517639155
21 changed files with 152 additions and 83 deletions

View file

@ -42,7 +42,7 @@ proc cleanUp(c: PPassContext, n: PNode): PNode =
if n.sons[namePos].kind == nkSym:
var s = n.sons[namePos].sym
if sfDeadCodeElim notin getModule(s).flags and not astNeeded(s):
s.ast.sons[codePos] = ast.emptyNode # free the memory
s.ast.sons[bodyPos] = ast.emptyNode # free the memory
else:
nil