cycle breaker (#13593)

* cycle breaking as an alternative to cycle detection
This commit is contained in:
Andreas Rumpf 2020-03-19 22:58:16 +01:00 • committed by GitHub
commit 35fb38629f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 298 additions and 41 deletions

View file

@ -696,8 +696,16 @@ proc checkRange(c: PEffects; value: PNode; typ: PType) =
checkLe(c, value, highBound)
proc createTypeBoundOps(tracked: PEffects, typ: PType; info: TLineInfo) =
if typ == nil: return
let realType = typ.skipTypes(abstractInst)
when false:
# XXX fix this in liftdestructors instead
if realType.kind == tyRef and
optSeqDestructors in tracked.config.globalOptions:
createTypeBoundOps(tracked.graph, tracked.c, realType.lastSon, info)
createTypeBoundOps(tracked.graph, tracked.c, typ, info)
if (typ != nil and tfHasAsgn in typ.flags) or
if (tfHasAsgn in typ.flags) or
optSeqDestructors in tracked.config.globalOptions:
tracked.owner.flags.incl sfInjectDestructors