codegen for user-defined destructors

This commit is contained in:
Zahary Karadjov 2012-05-25 19:02:14 +03:00
commit 337e1ecc7c
4 changed files with 87 additions and 2 deletions

View file

@ -1054,4 +1054,11 @@ proc getReturnType*(s: PSym): PType =
proc getSize(typ: PType): biggestInt =
result = computeSize(typ)
if result < 0: InternalError("getSize(" & $typ.kind & ')')
proc instantiateDestructor*(typ: PType): bool =
# return true if the type already had a user-defined
# destructor or if the compiler generated a default
# member-wise one
if typ.destructor != nil: return true
return false