Skip to content

Commit

Permalink
internal: remove disabled code in liftdestructors (#884)
Browse files Browse the repository at this point in the history
Remove commented-out `markUsed` calls within the `liftdestructors`
module. It's unlikely that they are going to be included again,
and removing them prevents the calls from showing up in whole-
project text searches.
  • Loading branch information
bung87 authored Sep 9, 2023
1 parent 7aff725 commit 1a9e85e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions compiler/sem/liftdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ proc considerAsgnOrSink(c: var TLiftCtx; t: PType; body, x, y: PNode;
(sfOverriden in op.flags or destructorOverriden):
if sfError in op.flags:
incl c.fn.flags, sfError
#else:
# markUsed(c.g.config, c.info, op, c.g.usageSym)
body.add newHookCall(c, op, x, y)
result = true
elif op == nil and destructorOverriden:
Expand All @@ -382,8 +380,6 @@ proc considerAsgnOrSink(c: var TLiftCtx; t: PType; body, x, y: PNode;
op = produceSym(c.g, c.c, t, c.kind, c.info, c.idgen)
if sfError in op.flags:
incl c.fn.flags, sfError
#else:
# markUsed(c.g.config, c.info, op, c.g.usageSym)
# We also now do generic instantiations in the destructor lifting pass:
if op.ast.isGenericRoutine:
op = instantiateGeneric(c, op, t, t.typeInst)
Expand Down Expand Up @@ -412,7 +408,6 @@ proc addDestructorCall(c: var TLiftCtx; orig: PType; body, x: PNode) =
doAssert op == t.destructor

if op != nil:
#markUsed(c.g.config, c.info, op, c.g.usageSym)
body.add destructorCall(c, op, x)
elif useNoGc(c, t):
internalError(
Expand All @@ -429,7 +424,6 @@ proc considerUserDefinedOp(c: var TLiftCtx; t: PType; body, x, y: PNode): bool =
op = instantiateGeneric(c, op, t, t.typeInst)
setAttachedOp(c.g, c.idgen.module, t, attachedDestructor, op)

#markUsed(c.g.config, c.info, op, c.g.usageSym)
body.add destructorCall(c, op, x)
result = true
#result = addDestructorCall(c, t, body, x)
Expand All @@ -448,7 +442,6 @@ proc considerUserDefinedOp(c: var TLiftCtx; t: PType; body, x, y: PNode): bool =
of attachedDeepCopy:
let op = getAttachedOp(c.g, t, attachedDeepCopy)
if op != nil:
#markUsed(c.g.config, c.info, op, c.g.usageSym)
body.add newDeepCopyCall(c, op, x, y)
result = true

Expand Down

0 comments on commit 1a9e85e

Please sign in to comment.