Skip to content

Commit

Permalink
tiny refactoring related to sink parameter inference logic (#21064)
Browse files Browse the repository at this point in the history
* tiny refactoring related to sink parameter inference logic

* Update compiler/sempass2.nim
  • Loading branch information
Araq authored Dec 10, 2022
1 parent f330b33 commit 2ebd71b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/sempass2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ proc passedToEffectsDelayedParam(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)

proc trackCall(tracked: PEffects; n: PNode) =
Expand Down
1 change: 0 additions & 1 deletion compiler/sinkparameter_inference.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ proc checkForSink*(config: ConfigRef; idgen: IdGenerator; owner: PSym; arg: PNod
var local = p # sink parameter?
passToSink(local)
]#
if optSinkInference notin config.options: return
case arg.kind
of nkSym:
if arg.sym.kind == skParam and
Expand Down

0 comments on commit 2ebd71b

Please sign in to comment.