explicit ID generation for easier IC (#15559)
* refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
This commit is contained in:
parent
7252a50fef
commit
226595515c
67 changed files with 853 additions and 903 deletions
|
|
@ -92,7 +92,7 @@ proc createTypeBoundOps(tracked: PEffects, typ: PType; info: TLineInfo) =
|
|||
optSeqDestructors in tracked.config.globalOptions:
|
||||
createTypeBoundOps(tracked.graph, tracked.c, realType.lastSon, info)
|
||||
|
||||
createTypeBoundOps(tracked.graph, tracked.c, typ, info)
|
||||
createTypeBoundOps(tracked.graph, tracked.c, typ, info, tracked.c.idgen)
|
||||
if (tfHasAsgn in typ.flags) or
|
||||
optSeqDestructors in tracked.config.globalOptions:
|
||||
tracked.owner.flags.incl sfInjectDestructors
|
||||
|
|
@ -219,7 +219,7 @@ proc markGcUnsafe(a: PEffects; reason: PNode) =
|
|||
if reason.kind == nkSym:
|
||||
a.owner.gcUnsafetyReason = reason.sym
|
||||
else:
|
||||
a.owner.gcUnsafetyReason = newSym(skUnknown, a.owner.name,
|
||||
a.owner.gcUnsafetyReason = newSym(skUnknown, a.owner.name, nextId a.c.idgen,
|
||||
a.owner, reason.info, {})
|
||||
|
||||
when true:
|
||||
|
|
@ -755,7 +755,7 @@ proc trackCall(tracked: PEffects; n: PNode) =
|
|||
if n.typ != nil:
|
||||
if tracked.owner.kind != skMacro and n.typ.skipTypes(abstractVar).kind != tyOpenArray:
|
||||
createTypeBoundOps(tracked, n.typ, n.info)
|
||||
if getConstExpr(tracked.ownerModule, n, tracked.graph) != nil:
|
||||
if getConstExpr(tracked.ownerModule, n, tracked.c.idgen, tracked.graph) != nil:
|
||||
return
|
||||
if a.kind == nkCast and a[1].typ.kind == tyProc:
|
||||
a = a[1]
|
||||
|
|
@ -829,7 +829,7 @@ proc trackCall(tracked: PEffects; n: PNode) =
|
|||
case op[i].kind
|
||||
of tySink:
|
||||
createTypeBoundOps(tracked, op[i][0], n.info)
|
||||
checkForSink(tracked.config, tracked.owner, n[i])
|
||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n[i])
|
||||
of tyVar:
|
||||
tracked.hasDangerousAssign = true
|
||||
#of tyOut:
|
||||
|
|
@ -947,7 +947,7 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
if tracked.owner.kind != skMacro:
|
||||
createTypeBoundOps(tracked, n[0].typ, n.info)
|
||||
if n[0].kind != nkSym or not isLocalVar(tracked, n[0].sym):
|
||||
checkForSink(tracked.config, tracked.owner, n[1])
|
||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n[1])
|
||||
if not tracked.hasDangerousAssign and n[0].kind != nkSym:
|
||||
tracked.hasDangerousAssign = true
|
||||
of nkVarSection, nkLetSection:
|
||||
|
|
@ -1054,9 +1054,9 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
if x.kind == nkExprColonExpr:
|
||||
if x[0].kind == nkSym:
|
||||
notNilCheck(tracked, x[1], x[0].sym.typ)
|
||||
checkForSink(tracked.config, tracked.owner, x[1])
|
||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, x[1])
|
||||
else:
|
||||
checkForSink(tracked.config, tracked.owner, x)
|
||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, x)
|
||||
setLen(tracked.guards.s, oldFacts)
|
||||
if tracked.owner.kind != skMacro:
|
||||
# XXX n.typ can be nil in runnableExamples, we need to do something about it.
|
||||
|
|
@ -1071,7 +1071,7 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
createTypeBoundOps(tracked, n[i][0].typ, n.info)
|
||||
else:
|
||||
createTypeBoundOps(tracked, n[i].typ, n.info)
|
||||
checkForSink(tracked.config, tracked.owner, n[i])
|
||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n[i])
|
||||
of nkPragmaBlock:
|
||||
let pragmaList = n[0]
|
||||
var bc = createBlockContext(tracked)
|
||||
|
|
@ -1122,7 +1122,7 @@ proc track(tracked: PEffects, n: PNode) =
|
|||
of nkBracket:
|
||||
for i in 0..<n.safeLen:
|
||||
track(tracked, n[i])
|
||||
checkForSink(tracked.config, tracked.owner, n[i])
|
||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n[i])
|
||||
if tracked.owner.kind != skMacro:
|
||||
createTypeBoundOps(tracked, n.typ, n.info)
|
||||
of nkBracketExpr:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue