From 21a161a535d915d34cb5bd6c340b8acc8c64ed90 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:01:21 +0800 Subject: [PATCH] remove nimfrs and varslot (#24126) was introduced for debugger https://github.com/nim-lang/Nim/commit/b63f322a466351bc57f8a4593009f0520c348527#diff-abd3a10386cf1ae32bfd3ffae82335a1938cc6c6d92be0ee492fcb44b9f2b552 https://github.com/nim-lang/Nim/blob/b63f322a466351bc57f8a4593009f0520c348527/lib/system/debugger.nim --- compiler/cgen.nim | 12 ++++-------- lib/core/typeinfo.nim | 10 ---------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 2fde0e9ffd..8a6bd96ecf 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -783,15 +783,11 @@ $1define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; #nimFrame(&FR_); - $1define nimfrs_(proc, file, slots, length) \ - struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ - FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; #nimFrame((TFrame*)&FR_); +$1define nimln_(n) \ + FR_.line = n; - $1define nimln_(n) \ - FR_.line = n; - - $1define nimlf_(n, file) \ - FR_.line = n; FR_.filename = file; +$1define nimlf_(n, file) \ + FR_.line = n; FR_.filename = file; """ if p.module.s[cfsFrameDefines].len == 0: diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim index 3c54338364..f2fee91c4f 100644 --- a/lib/core/typeinfo.nim +++ b/lib/core/typeinfo.nim @@ -161,16 +161,6 @@ proc newAny(value: pointer, rawType: PNimType): Any {.inline.} = result.value = value result.rawType = rawType -when declared(system.VarSlot): - proc toAny*(x: VarSlot): Any {.inline.} = - ## Constructs an `Any` object from a variable slot `x`. - ## This captures `x`'s address, so `x` can be modified with its - ## `Any` wrapper! The caller needs to ensure that the wrapper - ## **does not** live longer than `x`! - ## This is provided for easier reflection capabilities of a debugger. - result.value = x.address - result.rawType = x.typ - proc toAny*[T](x: var T): Any {.inline.} = ## Constructs an `Any` object from `x`. This captures `x`'s address, so ## `x` can be modified with its `Any` wrapper! The caller needs to ensure