diff --git a/compiler/backend/ccgexprs.nim b/compiler/backend/ccgexprs.nim index 256431a7165..5b0d3400ffa 100644 --- a/compiler/backend/ccgexprs.nim +++ b/compiler/backend/ccgexprs.nim @@ -906,15 +906,6 @@ proc genStrAppend(p: BProc, e: CgNode, d: var TLoc) = [byRefLoc(p, dest), lens, L]) p.s(cpsStmts).add appends -proc genReset(p: BProc, n: CgNode) = - var a: TLoc - initLocExpr(p, n[1], a) - specializeReset(p, a) - when false: - linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n", - [addrLoc(p.config, a), - genTypeInfoV1(p.module, skipTypes(a.t, {tyVar}), n.info)]) - proc genDefault(p: BProc; n: CgNode; d: var TLoc) = if d.k == locNone: getTemp(p, n.typ, d, needsInit=true) else: resetLoc(p, d) @@ -983,9 +974,6 @@ proc handleConstExpr(p: BProc, n: CgNode, d: var TLoc): bool = else: result = false -# XXX: maybe move the `specializeInitObject` procs into a separate module -# (similiar to `specializeReset`) - proc specializeInitObject(p: BProc, accessor: Rope, typ: PType, info: TLineInfo) @@ -1074,7 +1062,7 @@ proc specializeInitObject(p: BProc, accessor: Rope, typ: PType, if t.n != nil and searchTypeNodeFor(t.n, pred): specializeInitObjectN(p, a, t.n, t) - a = parentObj(a) + a.add ".Sup" t = t.base # type header: @@ -1864,7 +1852,6 @@ proc genMagicExpr(p: BProc, e: CgNode, d: var TLoc, op: TMagic) = genCall(p, e, d) of mDefault: genDefault(p, e, d) - of mReset: genReset(p, e) of mEcho: genEcho(p, e[1].skipConv) of mArrToSeq: genArrToSeq(p, e, d) of mNLen..mNError, mSlurp..mQuoteAst: diff --git a/compiler/backend/ccgreset.nim b/compiler/backend/ccgreset.nim deleted file mode 100644 index 28f2e6f1b70..00000000000 --- a/compiler/backend/ccgreset.nim +++ /dev/null @@ -1,98 +0,0 @@ -# -# -# The Nim Compiler -# (c) Copyright 2020 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -# included from cgen.nim - -## Code specialization instead of the old, incredibly slow 'genericReset' -## implementation. - -proc genCaseRange(p: BProc, branch: PNode|CgNode) -proc getTemp(p: BProc, t: PType, result: var TLoc; needsInit=false) - -proc specializeResetT(p: BProc, accessor: Rope, typ: PType) - -proc parentObj(accessor: Rope): Rope {.inline.} = - result = "$1.Sup" % [accessor] - -proc specializeResetN(p: BProc, accessor: Rope, n: PNode; - typ: PType) = - if n == nil: return - case n.kind - of nkRecList: - for i in 0..