cleanup destructor building for arrays; still doesn't work

This commit is contained in:
Araq
2015-08-18 13:57:37 +02:00
parent 69b32637b1
commit d634da775d
3 changed files with 15 additions and 27 deletions

View File

@@ -190,7 +190,6 @@ proc resetMemory =
resetRopeCache()
resetSysTypes()
gOwners = @[]
rangeDestructorProc = nil
for i in low(buckets)..high(buckets):
buckets[i] = nil
idAnon = nil
@@ -237,7 +236,7 @@ proc mainCommand* =
when SimulateCaasMemReset:
gGlobalOptions.incl(optCaasEnabled)
# In "nimrod serve" scenario, each command must reset the registered passes
# In "nim serve" scenario, each command must reset the registered passes
clearPasses()
gLastCmdTime = epochTime()
appendStr(searchPaths, options.libpath)

View File

@@ -24,7 +24,6 @@ var
destructorName = getIdent"destroy_"
destructorParam = getIdent"this_"
destructorPragma = newIdentNode(getIdent"destructor", unknownLineInfo())
rangeDestructorProc*: PSym
proc instantiateDestructor(c: PContext, typ: PType): PType
@@ -141,9 +140,7 @@ proc instantiateDestructor(c: PContext, typ: PType): PType =
case t.kind
of tySequence, tyArray, tyArrayConstr, tyOpenArray, tyVarargs:
if instantiateDestructor(c, t.sons[0]) != nil:
if rangeDestructorProc == nil:
rangeDestructorProc = searchInScopes(c, getIdent"nimDestroyRange")
t.destructor = rangeDestructorProc
t.destructor = getCompilerProc"nimDestroyRange"
return t
else:
return nil