tiny refactoring related to sink parameter inference logic (#21064)
* tiny refactoring related to sink parameter inference logic * Update compiler/sempass2.nim
This commit is contained in:
parent
f330b33e2b
commit
2ebd71bfd4
2 changed files with 1 additions and 2 deletions
|
|
@ -814,7 +814,7 @@ proc passedToEffectsDelayedParam(tracked: PEffects; n: PNode) =
|
||||||
]#
|
]#
|
||||||
|
|
||||||
proc checkForSink(tracked: PEffects; n: PNode) =
|
proc checkForSink(tracked: PEffects; n: PNode) =
|
||||||
if tracked.inIfStmt == 0:
|
if tracked.inIfStmt == 0 and optSinkInference in tracked.config.options:
|
||||||
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n)
|
checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n)
|
||||||
|
|
||||||
proc trackCall(tracked: PEffects; n: PNode) =
|
proc trackCall(tracked: PEffects; n: PNode) =
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ proc checkForSink*(config: ConfigRef; idgen: IdGenerator; owner: PSym; arg: PNod
|
||||||
var local = p # sink parameter?
|
var local = p # sink parameter?
|
||||||
passToSink(local)
|
passToSink(local)
|
||||||
]#
|
]#
|
||||||
if optSinkInference notin config.options: return
|
|
||||||
case arg.kind
|
case arg.kind
|
||||||
of nkSym:
|
of nkSym:
|
||||||
if arg.sym.kind == skParam and
|
if arg.sym.kind == skParam and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue