destroyer pass: adaptations for the new destructor based runtime
This commit is contained in:
parent
ef4b755183
commit
700448f359
2 changed files with 27 additions and 7 deletions
|
|
@ -258,8 +258,10 @@ proc registerDropBit(c: var Con; s: PSym) =
|
|||
c.toDropBit[s.id] = result
|
||||
# generate:
|
||||
# if not sinkParam_AliveBit: `=destroy`(sinkParam)
|
||||
c.destroys.add newTree(nkIfStmt,
|
||||
newTree(nkElifBranch, newSymNode result, genDestroy(c, s.typ, newSymNode s)))
|
||||
let t = s.typ.skipTypes({tyGenericInst, tyAlias, tySink})
|
||||
if t.destructor != nil:
|
||||
c.destroys.add newTree(nkIfStmt,
|
||||
newTree(nkElifBranch, newSymNode result, genDestroy(c, t, newSymNode s)))
|
||||
|
||||
proc p(n: PNode; c: var Con): PNode
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue