Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codegen: remove obsolete mReset support #827

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions compiler/backend/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
98 changes: 0 additions & 98 deletions compiler/backend/ccgreset.nim

This file was deleted.

2 changes: 0 additions & 2 deletions compiler/backend/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: TLoc,
let tmp = defaultValueExpr(p, t, a.lode.info)
genAssignment(p, a, tmp)

include ccgreset

proc constructLoc(p: BProc, loc: var TLoc, isTemp = false; doInitObj = true) =
let kind = mapTypeChooser(loc)
case mapType(p.config, loc.t, kind)
Expand Down
2 changes: 1 addition & 1 deletion compiler/backend/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ proc genMagic(p: PProc, n: CgNode, r: var TCompRes) =
of mNewSeqOfCap: unaryExpr(p, n, r, "", "[]")
of mOf: genOf(p, n, r)
of mDefault: genDefault(p, n, r)
of mReset, mWasMoved: genReset(p, n)
of mWasMoved: genReset(p, n)
of mEcho: genEcho(p, n, r)
of mNLen..mNError, mSlurp, mStaticExec:
localReport(p.config, n.info, reportSym(
Expand Down
2 changes: 1 addition & 1 deletion compiler/vm/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ proc genMagic(c: var TCtx; n: CgNode; dest: var TDest; m: TMagic) =
c.freeTemp(tmp1)
c.freeTemp(tmp2)
c.freeTemp(tmp3)
of mReset, mWasMoved:
of mWasMoved:
unused(c, n, dest)
let
(dest, isDirect) = genNoLoad(c, n[1])
Expand Down
Loading