cleanup nfFirstWrite flags (#20500)

This commit is contained in:
Andreas Rumpf 2022-10-05 11:50:16 +02:00 • committed by GitHub
commit 9d858a29fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 nfExecuteOnReload # A top-level statement that will be executed during reloads
nfLastRead # this node is a last read nfLastRead # this node is a last read
nfFirstWrite # this node is a first write nfFirstWrite # this node is a first write
nfFirstWrite2 # alternative first write implementation
nfHasComment # node has a comment nfHasComment # node has a comment
nfUseDefaultField # node has a default value (object constructor) nfUseDefaultField # node has a default value (object constructor)
@ -1078,7 +1077,7 @@ const
nfIsRef, nfIsPtr, nfPreventCg, nfLL, nfIsRef, nfIsPtr, nfPreventCg, nfLL,
nfFromTemplate, nfDefaultRefsParam, nfFromTemplate, nfDefaultRefsParam,
nfExecuteOnReload, nfLastRead, nfExecuteOnReload, nfLastRead,
nfFirstWrite, nfFirstWrite2} nfFirstWrite}
namePos* = 0 namePos* = 0
patternPos* = 1 # empty except for term rewriting macros patternPos* = 1 # empty except for term rewriting macros
genericParamsPos* = 2 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 = proc isFirstWrite(n: PNode; c: var Con): bool =
let m = skipConvDfa(n) let m = skipConvDfa(n)
result = nfFirstWrite2 in m.flags result = nfFirstWrite in m.flags
proc isCursor(n: PNode): bool = proc isCursor(n: PNode): bool =
case n.kind case n.kind

View file

@ -249,7 +249,7 @@ proc genCreateEnv(env: PNode): PNode =
var c = newNodeIT(nkObjConstr, env.info, env.typ) var c = newNodeIT(nkObjConstr, env.info, env.typ)
c.add newNodeIT(nkType, env.info, env.typ) c.add newNodeIT(nkType, env.info, env.typ)
let e = copyTree(env) let e = copyTree(env)
e.flags.incl nfFirstWrite2 e.flags.incl nfFirstWrite
result = newAsgnStmt(e, c) result = newAsgnStmt(e, c)
proc liftIterSym*(g: ModuleGraph; n: PNode; idgen: IdGenerator; owner: PSym): PNode = 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 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. 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) = proc initVarViaNew(a: PEffects, n: PNode) =
if n.kind != nkSym: return 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 = newTransNode(kind, ri.info, 2)
result[0] = le result[0] = le
if isFirstWrite: if isFirstWrite:
le.flags.incl nfFirstWrite2 le.flags.incl nfFirstWrite
result[1] = ri result[1] = ri
proc transformSymAux(c: PTransf, n: PNode): PNode = proc transformSymAux(c: PTransf, n: PNode): PNode =