Activating Two-Phase Borrows
activateTwophaseBorrowCreatedAt
reserveLocation is a function from borrow edges to the MIR location at which the borrow edge was created.
The activateTwophaseBorrowCreatedAt operation takes a single parameter:
- , a MIR location
The operation is implemented as follows:
- If there exists a borrow edge in the graph such that l = reserveLocation(e):
- If there exists a place node for in the graph:
- Restore capability to
- If is not owned:
- Downgrade the capability of every ancestor of to None
- If there exists a place node for in the graph:
- TODO Logic is bad