Skip to content

Commit

Permalink
koch boot compiler with orc (#20467)
Browse files Browse the repository at this point in the history
* koch boot compiler with orc

* use orc

* workaround bugs

* move it

* move the data
  • Loading branch information
ringabout authored Sep 30, 2022
1 parent 3e43ea3 commit ae050b0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion compiler/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ define:booting
define:nimcore
define:nimPreviewFloatRoundtrip
define:nimPreviewSlimSystem
gc:refc

#import:"$projectpath/testability"

Expand Down
2 changes: 1 addition & 1 deletion compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ proc semTry(c: PContext, n: PNode; flags: TExprFlags; expectedType: PType = nil)

if a.len == 2 and a[0].kind == nkBracket:
# rewrite ``except [a, b, c]: body`` -> ```except a, b, c: body```
a.sons[0..0] = a[0].sons
a.sons[0..0] = move a[0].sons

if a.len == 2 and a[0].isInfixAs():
# support ``except Exception as ex: body``
Expand Down
7 changes: 2 additions & 5 deletions koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ proc runCI(cmd: string) =
# boot without -d:nimHasLibFFI to make sure this still works
# `--lib:lib` is needed for bootstrap on openbsd, for reasons described in
# https://github.com/nim-lang/Nim/pull/14291 (`getAppFilename` bugsfor older nim on openbsd).
kochExecFold("Boot in release mode", "boot -d:release -d:nimStrictMode --lib:lib")
kochExecFold("Boot in release mode", "boot -d:release --gc:refc -d:nimStrictMode --lib:lib")
kochExecFold("Boot Nim ORC", "boot -d:release --lib:lib")

when false: # debugging: when you need to run only 1 test in CI, use something like this:
execFold("debugging test", "nim r tests/stdlib/tosproc.nim")
Expand Down Expand Up @@ -591,10 +592,6 @@ proc runCI(cmd: string) =

execFold("Run atlas tests", "nim c -r -d:atlasTests tools/atlas/atlas.nim clone https://github.com/disruptek/balls")

when not defined(bsd):
# the BSDs are overwhelmed already, so only run this test on the other machines:
kochExecFold("Boot Nim ORC", "boot -d:release --mm:orc --lib:lib")

proc testUnixInstall(cmdLineRest: string) =
csource("-d:danger" & cmdLineRest)
xz(false, cmdLineRest)
Expand Down
4 changes: 2 additions & 2 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1211,10 +1211,10 @@ else:


when defined(nimSeqsV2):
template movingCopy(a, b) =
template movingCopy(a, b: typed) =
a = move(b)
else:
template movingCopy(a, b) =
template movingCopy(a, b: typed) =
shallowCopy(a, b)

proc del*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
Expand Down
3 changes: 1 addition & 2 deletions lib/system/indices.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template `[]=`*(s: string; i: int; val: char) = arrPut(s, i, val)
template `^^`(s, i: untyped): untyped =
(when i is BackwardsIndex: s.len - int(i) else: int(i))

template spliceImpl(s, a, L, b: untyped): untyped =
template spliceImpl(s, a, L, b: typed): untyped =
# make room for additional elements or cut:
var shift = b.len - max(0,L) # ignore negative slice size
var newLen = s.len + shift
Expand Down Expand Up @@ -147,7 +147,6 @@ proc `[]=`*[T; U, V: Ordinal](s: var seq[T], x: HSlice[U, V], b: openArray[T]) =
var s = @"abcdefgh"
s[1 .. ^2] = @"xyz"
assert s == @"axyzh"

let a = s ^^ x.a
let L = (s ^^ x.b) - a + 1
if L == b.len:
Expand Down

0 comments on commit ae050b0

Please sign in to comment.