remove shallowCopy for ARC/ORC (#20070)

* remove shallowCopy for ARC/ORC

* use move

* fix

* more fixes

* typo

* Update lib/system.nim

* follow

* add nodestroy

* move

* copy string

* add a changelog entry

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
ringabout 2022-07-26 22:51:01 +08:00 • committed by GitHub
commit 4c46358db1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 76 additions and 30 deletions

View file

@ -114,8 +114,12 @@ template decodeBx(k: untyped) {.dirty.} =
let rbx = instr.regBx - wordExcess
ensureKind(k)
template move(a, b: untyped) {.dirty.} = system.shallowCopy(a, b)
# XXX fix minor 'shallowCopy' overloading bug in compiler
template move(a, b: untyped) {.dirty.} =
when defined(gcArc) or defined(gcOrc):
a = move b
else:
system.shallowCopy(a, b)
# XXX fix minor 'shallowCopy' overloading bug in compiler
proc derefPtrToReg(address: BiggestInt, typ: PType, r: var TFullReg, isAssign: bool): bool =
# nim bug: `isAssign: static bool` doesn't work, giving odd compiler error