destructors: preparations for upcoming changes

This commit is contained in:
Araq 2017-10-17 12:46:49 +02:00
commit 45d74f4081
8 changed files with 27 additions and 8 deletions

View file

@ -95,8 +95,6 @@ import
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents, trees,
strutils, options, dfa, lowerings
template hasDestructor(t: PType): bool = tfHasAsgn in t.flags
const
InterestingSyms = {skVar, skResult, skLet}
@ -253,6 +251,7 @@ proc p(n: PNode; c: var Con): PNode =
result = copyNode(n)
recurse(n, result)
of nkAsgn, nkFastAsgn:
# XXX if special, call special operator
if n[0].kind == nkSym and interestingSym(n[0].sym):
result = moveOrCopy(n[0], n[1], c)
else: