IC: green tests (#17311)
* IC: renamed to_packed_ast module to ic module * IC: don't store the --forceBuild flag, makes it easier to test * IC: enable hello world test * Codegen: refactorings for IC; changed the name mangling algorithm * fixed the HCR regressions * life is too short for HCR * tconvexhull is now allowed to use deepCopy * IC exposed a stdlib bug, required a refactoring * codegen: code cleanups * IC: even if a module is outdated, its dependencies might come from disk * IC: progress * IC: better name mangling, module IDs are not stable * IC: another refactoring helping with --ic:on --gc:arc * disable arraymancer on Windows for the time being * disable arraymancer altogether * IC: make basic test work with 'nim cpp' * IC: progress on --ic:on --gc:arc * wip; name mangling for type info
This commit is contained in:
parent
60fc7e986b
commit
6c1c8f51b3
30 changed files with 249 additions and 187 deletions
|
|
@ -397,12 +397,12 @@ proc analyse(c: var AnalysisCtx; n: PNode) =
|
|||
else:
|
||||
analyseSons(c, n)
|
||||
|
||||
proc transformSlices(g: ModuleGraph; n: PNode): PNode =
|
||||
proc transformSlices(g: ModuleGraph; idgen: IdGenerator; n: PNode): PNode =
|
||||
if n.kind in nkCallKinds and n[0].kind == nkSym:
|
||||
let op = n[0].sym
|
||||
if op.name.s == "[]" and op.fromSystem:
|
||||
result = copyNode(n)
|
||||
let opSlice = newSymNode(createMagic(g, "slice", mSlice))
|
||||
let opSlice = newSymNode(createMagic(g, idgen, "slice", mSlice))
|
||||
opSlice.typ = getSysType(g, n.info, tyInt)
|
||||
result.add opSlice
|
||||
result.add n[1]
|
||||
|
|
@ -413,11 +413,11 @@ proc transformSlices(g: ModuleGraph; n: PNode): PNode =
|
|||
if n.safeLen > 0:
|
||||
result = shallowCopy(n)
|
||||
for i in 0..<n.len:
|
||||
result[i] = transformSlices(g, n[i])
|
||||
result[i] = transformSlices(g, idgen, n[i])
|
||||
else:
|
||||
result = n
|
||||
|
||||
proc transformSpawn(g: ModuleGraph; idgen: IdGenerator;owner: PSym; n, barrier: PNode): PNode
|
||||
proc transformSpawn(g: ModuleGraph; idgen: IdGenerator; owner: PSym; n, barrier: PNode): PNode
|
||||
proc transformSpawnSons(g: ModuleGraph; idgen: IdGenerator; owner: PSym; n, barrier: PNode): PNode =
|
||||
result = shallowCopy(n)
|
||||
for i in 0..<n.len:
|
||||
|
|
@ -431,7 +431,7 @@ proc transformSpawn(g: ModuleGraph; idgen: IdGenerator; owner: PSym; n, barrier:
|
|||
let b = it.lastSon
|
||||
if getMagic(b) == mSpawn:
|
||||
if it.len != 3: localError(g.config, it.info, "invalid context for 'spawn'")
|
||||
let m = transformSlices(g, b)
|
||||
let m = transformSlices(g, idgen, b)
|
||||
if result.isNil:
|
||||
result = newNodeI(nkStmtList, n.info)
|
||||
result.add n
|
||||
|
|
@ -446,12 +446,12 @@ proc transformSpawn(g: ModuleGraph; idgen: IdGenerator; owner: PSym; n, barrier:
|
|||
let b = n[1]
|
||||
if getMagic(b) == mSpawn and (let t = b[1][0].typ[0];
|
||||
spawnResult(t, true) == srByVar):
|
||||
let m = transformSlices(g, b)
|
||||
let m = transformSlices(g, idgen, b)
|
||||
return wrapProcForSpawn(g, idgen, owner, m, b.typ, barrier, n[0])
|
||||
result = transformSpawnSons(g, idgen, owner, n, barrier)
|
||||
of nkCallKinds:
|
||||
if getMagic(n) == mSpawn:
|
||||
result = transformSlices(g, n)
|
||||
result = transformSlices(g, idgen, n)
|
||||
return wrapProcForSpawn(g, idgen, owner, result, n.typ, barrier, nil)
|
||||
result = transformSpawnSons(g, idgen, owner, n, barrier)
|
||||
elif n.safeLen > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue