Distinguish between lvals and rvals in captured closure environment

Description

Some closures (in particular those generated by the lowerer to implement at and async) need to capture an lval instead of an rval. When generating code for such closures, the backends need to know whether it is the lval or rval of a variable that is being captured. The proposal is to split the closure environment capture information into two lists: lvals and rvals instead of one and then use that information instead of the asyncInit in the backends.

A test case that illustrates the various issues is appended. In particular, in TestValInitUsingAt in the two closures coming from the first set of at statements the lval is captured, but in the two closures coming from the second set of ats the rval is captured.

Environment

None

Status

Assignee

Olivier Tardieu

Reporter

DaveG

Labels

None

Components

Fix versions

Priority

High
Configure