cleanup nfFirstWrite flags (#20500)

This commit is contained in:
Andreas Rumpf
2022-10-05 11:50:16 +02:00
committed by GitHub
parent 3e2b30879c
commit 9d858a29fc
5 changed files with 5 additions and 6 deletions

View File

@@ -509,7 +509,6 @@ type
nfExecuteOnReload # A top-level statement that will be executed during reloads
nfLastRead # this node is a last read
nfFirstWrite # this node is a first write
nfFirstWrite2 # alternative first write implementation
nfHasComment # node has a comment
nfUseDefaultField # node has a default value (object constructor)
@@ -1078,7 +1077,7 @@ const
nfIsRef, nfIsPtr, nfPreventCg, nfLL,
nfFromTemplate, nfDefaultRefsParam,
nfExecuteOnReload, nfLastRead,
nfFirstWrite, nfFirstWrite2}
nfFirstWrite}
namePos* = 0
patternPos* = 1 # empty except for term rewriting macros
genericParamsPos* = 2

View File

@@ -162,7 +162,7 @@ proc isLastRead(n: PNode; c: var Con; s: var Scope): bool =
proc isFirstWrite(n: PNode; c: var Con): bool =
let m = skipConvDfa(n)
result = nfFirstWrite2 in m.flags
result = nfFirstWrite in m.flags
proc isCursor(n: PNode): bool =
case n.kind

View File

@@ -249,7 +249,7 @@ proc genCreateEnv(env: PNode): PNode =
var c = newNodeIT(nkObjConstr, env.info, env.typ)
c.add newNodeIT(nkType, env.info, env.typ)
let e = copyTree(env)
e.flags.incl nfFirstWrite2
e.flags.incl nfFirstWrite
result = newAsgnStmt(e, c)
proc liftIterSym*(g: ModuleGraph; n: PNode; idgen: IdGenerator; owner: PSym): PNode =

View File

@@ -218,7 +218,7 @@ proc initVar(a: PEffects, n: PNode; volatileCheck: bool) =
run outside of the while loop. This is why we need the check here that
the assignment is done in the same logical block as `x` was declared in.
]#
n.flags.incl nfFirstWrite2
n.flags.incl nfFirstWrite
proc initVarViaNew(a: PEffects, n: PNode) =
if n.kind != nkSym: return

View File

@@ -107,7 +107,7 @@ proc newAsgnStmt(c: PTransf, kind: TNodeKind, le: PNode, ri: PNode; isFirstWrite
result = newTransNode(kind, ri.info, 2)
result[0] = le
if isFirstWrite:
le.flags.incl nfFirstWrite2
le.flags.incl nfFirstWrite
result[1] = ri
proc transformSymAux(c: PTransf, n: PNode): PNode =