cps
cps copied to clipboard
optimize locals to the stack
When locals aren't used in remote legs, we don't need to move them to the environment.
This one is particularly hard, consider:
proc foo() =
var s = "string"
var c = cstring(s)
noop()
echo $c
Despite only c is used in the following continuation, we must keep s because c leases s resource.