[cleanup] remove unnecessary procs in vm (#19888)

remove unused procs
This commit is contained in:
flywind 2022-06-13 14:10:40 +08:00 • committed by GitHub
commit 2f4900615a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -2252,7 +2252,6 @@ proc setupMacroParam(x: PNode, typ: PType): TFullReg =
else: else:
var n = x var n = x
if n.kind in {nkHiddenSubConv, nkHiddenStdConv}: n = n[1] if n.kind in {nkHiddenSubConv, nkHiddenStdConv}: n = n[1]
n = n.canonValue
n.flags.incl nfIsRef n.flags.incl nfIsRef
n.typ = x.typ n.typ = x.typ
result = TFullReg(kind: rkNode, node: n) result = TFullReg(kind: rkNode, node: n)

View file

@ -439,14 +439,11 @@ proc genAndOr(c: PCtx; n: PNode; opc: TOpcode; dest: var TDest) =
c.gABC(n, opcAsgnInt, dest, tmp) c.gABC(n, opcAsgnInt, dest, tmp)
freeTemp(c, tmp) freeTemp(c, tmp)
proc canonValue*(n: PNode): PNode =
result = n
proc rawGenLiteral(c: PCtx; n: PNode): int = proc rawGenLiteral(c: PCtx; n: PNode): int =
result = c.constants.len result = c.constants.len
#assert(n.kind != nkCall) #assert(n.kind != nkCall)
n.flags.incl nfAllConst n.flags.incl nfAllConst
c.constants.add n.canonValue c.constants.add n
internalAssert c.config, result < regBxMax internalAssert c.config, result < regBxMax
proc sameConstant*(a, b: PNode): bool = proc sameConstant*(a, b: PNode): bool =
@ -1857,7 +1854,7 @@ proc genVarSection(c: PCtx; n: PNode) =
else: else:
let sa = getNullValue(s.typ, a.info, c.config) let sa = getNullValue(s.typ, a.info, c.config)
#if s.ast.isNil: getNullValue(s.typ, a.info) #if s.ast.isNil: getNullValue(s.typ, a.info)
#else: canonValue(s.ast) #else: s.ast
assert sa.kind != nkCall assert sa.kind != nkCall
c.globals.add(sa) c.globals.add(sa)
s.position = c.globals.len s.position = c.globals.len