Function Calls
Consider a function call . Each is an operand of the form move p | copy p | const c
.
Let be the set of moved operand places, and let
denote the program point where was last modified.
The function call abstraction is created in the PostMain
evalution stage,
after all of the operands have been evaluated. Therefore, all places in
are labelled, as they have been moved-out by this point.
Creating the Function Call Abstraction Graph
The PCG constructs a function call abstraction graph to reflect the effect of the call.
We begin by determining how may manipulate the borrows in by constructing the bipartite graph as follows:
Let be the set of lifetime projections in . For any place , we define as the place .
Let be the set .
Let be the set .
Add all nodes in to
For each if is nested in , and outlives , we add to a Function Call Abstraction Edge .
The function call abstraction graph is constructed by adding to
edges such that for every lifetime in ,
we define the set , and add a BorrowFlow
edge .
Adding the Function Call Abstraction Graph to the PCG
We add an abstraction graph to a PCG to create a new PCG as follows.
First, we initialize as . For each projection in , we modify as follows:
- For each endpoint in whose target is , redirect the target to .
- For each
Future
edge in , remove the edge, and for each leaf in with an ancestor {n} \rightarrow p' \downarrow r' to . - Remove from .