work in progress: a dataflow architecture for Nim

This commit is contained in:
Andreas Rumpf 2017-10-07 09:35:45 +02:00
commit b9511a2d7f
2 changed files with 416 additions and 2 deletions

View file

@ -9,7 +9,7 @@
import
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents, trees,
wordrecg, strutils, options, guards, writetracking
wordrecg, strutils, options, guards, writetracking, dfa
# Second semantic checking pass over the AST. Necessary because the old
# way had some inherent problems. Performs:
@ -979,7 +979,9 @@ proc trackProc*(s: PSym, body: PNode) =
message(s.info, warnLockLevel,
"declared lock level is $1, but real lock level is $2" %
[$s.typ.lockLevel, $t.maxLockLevel])
if s.kind == skFunc: trackWrites(s, body)
if s.kind == skFunc:
dataflowAnalysis(s, body)
trackWrites(s, body)
proc trackTopLevelStmt*(module: PSym; n: PNode) =
if n.kind in {nkPragma, nkMacroDef, nkTemplateDef, nkProcDef, nkFuncDef,