Show that a variable is cursor in --expandArc (#15002)

This commit is contained in:
Clyybber 2020-07-17 10:56:17 +02:00 • committed by GitHub
commit 1355b461aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 23 deletions

View file

@ -35,7 +35,6 @@ type
Con = object
owner: PSym
g: ControlFlowGraph
cursors: IntSet
graph: ModuleGraph
otherRead: PNode
inLoop, inSpawn: int
@ -152,13 +151,13 @@ proc isLastRead(location: PNode; cfg: ControlFlowGraph; otherRead: var PNode; pc
proc isCursor(n: PNode; c: Con): bool =
case n.kind
of nkSym:
result = sfCursor in n.sym.flags or c.cursors.contains(n.sym.id)
sfCursor in n.sym.flags
of nkDotExpr:
result = sfCursor in n[1].sym.flags
isCursor(n[1], c)
of nkCheckedFieldExpr:
result = isCursor(n[0], c)
isCursor(n[0], c)
else:
result = false
false
proc isLastRead(n: PNode; c: var Con): bool =
# first we need to search for the instruction that belongs to 'n':
@ -1043,7 +1042,7 @@ proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
echoCfg(c.g)
echo n
c.cursors = computeCursors(n, g.config)
computeCursors(n, g.config)
var scope: Scope
let body = p(n, c, scope, normal)