koch.nim compiles with --newruntime
This commit is contained in:
parent
a4883b8426
commit
72408842d9
2 changed files with 9 additions and 5 deletions
|
|
@ -438,10 +438,10 @@ proc passCopyToSink(n: PNode; c: var Con): PNode =
|
||||||
result.add tmp
|
result.add tmp
|
||||||
|
|
||||||
proc pArg(arg: PNode; c: var Con; isSink: bool): PNode =
|
proc pArg(arg: PNode; c: var Con; isSink: bool): PNode =
|
||||||
template pArgIfTyped(arg_part: PNode): PNode =
|
template pArgIfTyped(argPart: PNode): PNode =
|
||||||
# typ is nil if we are in if/case expr branch with noreturn
|
# typ is nil if we are in if/case expr branch with noreturn
|
||||||
if arg_part.typ == nil: p(arg_part, c)
|
if argPart.typ == nil: p(argPart, c)
|
||||||
else: pArg(arg_part, c, isSink)
|
else: pArg(argPart, c, isSink)
|
||||||
|
|
||||||
if isSink:
|
if isSink:
|
||||||
if arg.kind in nkCallKinds:
|
if arg.kind in nkCallKinds:
|
||||||
|
|
@ -728,6 +728,10 @@ proc p(n: PNode; c: var Con): PNode =
|
||||||
result.add n[0]
|
result.add n[0]
|
||||||
# Analyse the inner expression
|
# Analyse the inner expression
|
||||||
result.add p(n[1], c)
|
result.add p(n[1], c)
|
||||||
|
of nkWhen:
|
||||||
|
# This should be a "when nimvm" node.
|
||||||
|
result = copyTree(n)
|
||||||
|
result[1][0] = p(result[1][0], c)
|
||||||
of nkRaiseStmt:
|
of nkRaiseStmt:
|
||||||
if optNimV2 in c.graph.config.globalOptions:
|
if optNimV2 in c.graph.config.globalOptions:
|
||||||
# this is a bit hacky but we simply do not destroy exceptions that have
|
# this is a bit hacky but we simply do not destroy exceptions that have
|
||||||
|
|
|
||||||
|
|
@ -707,9 +707,9 @@ proc track(tracked: PEffects, n: PNode) =
|
||||||
let op = a.typ
|
let op = a.typ
|
||||||
if getConstExpr(tracked.ownerModule, n, tracked.graph) != nil:
|
if getConstExpr(tracked.ownerModule, n, tracked.graph) != nil:
|
||||||
return
|
return
|
||||||
if op != nil:
|
if n.typ != nil:
|
||||||
if tracked.owner.kind != skMacro:
|
if tracked.owner.kind != skMacro:
|
||||||
createTypeBoundOps(tracked.c, op, n.info)
|
createTypeBoundOps(tracked.c, n.typ, n.info)
|
||||||
if a.kind == nkCast and a[1].typ.kind == tyProc:
|
if a.kind == nkCast and a[1].typ.kind == tyProc:
|
||||||
a = a[1]
|
a = a[1]
|
||||||
# XXX: in rare situations, templates and macros will reach here after
|
# XXX: in rare situations, templates and macros will reach here after
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue