From 9753dd0a1bd4a9993941dcd1e39d930bd2bb8bf0 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:50:59 +0800 Subject: [PATCH] remove `shallow` usages for ORC (#20109) --- compiler/ccgtypes.nim | 6 ++++-- compiler/msgs.nim | 3 ++- lib/pure/asyncnet.nim | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 7c26db40d7..16768685b5 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -84,7 +84,8 @@ proc mangleLocalName(p: BProc; s: PSym): Rope = result = s.loc.r if result == nil: var key = s.name.s.mangle - shallow(key) + when not defined(nimSeqsV2): + shallow(key) let counter = p.sigConflicts.getOrDefault(key) result = key.rope if s.kind == skTemp: @@ -102,7 +103,8 @@ proc scopeMangledParam(p: BProc; param: PSym) = ## generate unique identifiers reliably (consider that ``var a = a`` is ## even an idiom in Nim). var key = param.name.s.mangle - shallow(key) + when not defined(nimSeqsV2): + shallow(key) p.sigConflicts.inc(key) const diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 50bd94cda0..3b25da62a7 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -101,7 +101,8 @@ proc fileInfoIdx*(conf: ConfigRef; filename: AbsoluteFile; isKnownFile: var bool try: canon = canonicalizePath(conf, filename) - shallow(canon.string) + when not defined(nimSeqsV2): + shallow(canon.string) except OSError: canon = filename # The compiler uses "filenames" such as `command line` or `stdin` diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index 61c2fc75ac..cd02e5df5b 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -399,7 +399,8 @@ proc recv*(socket: AsyncSocket, size: int, ## to be read then the future will complete with a value of `""`. if socket.isBuffered: result = newString(size) - shallow(result) + when not defined(nimSeqsV2): + shallow(result) let originalBufPos = socket.currPos if socket.bufLen == 0: