Allocate BitArrays in PtrVarState. Can be allocated much more efficiently by subdividing a single large array of bits
Allocate state variables foreach node.
Check for Ownership/Borrowing errors.
Find the pointer variable declarations in this function, and fill vars with them.
Compute predecessors.
Do the data flow analysis (i.e. compute the input[] and output[] vectors for each ObNode).
Compute the gen vector for ob.
Does type t have any mutable fields?
Does type t contain any pointers to mutable?
Insert finally block calls when doing a goto from inside a try block to outside. Done after blocks are generated because then we know all the edges of the graph, but before the pred's are computed.
Remove try-finally scaffolding.
Does v meet the definiton of a Borrowed pointer?
Is type t a reference to a const or a reference to a mutable?
Does v meet the definiton of a Readonly pointer?
Are we interested in tracking variable v?
Are we interested in tracking this expression?
Recursively make Undefined all who list vi as a dependency
Recursively make Undefined vi undefined and all who list vi as a dependency
Set the index field of each ObNode to its index in the obnodes[] array.
Perform ownership/borrowing checks for funcdecl. Does not modify the AST, just checks for errors.
Read from variable vi. The beginning of the 'scope' of a variable is when it is first read. Hence, when a read is done, instead of when assignment to the variable is done, the O/B rules are enforced. (Also called "non-lexical scoping".)
Remove unreachable nodes and compress them out of obnodes[].
Set the .extra field for LabelStatements in labtab[].
Convert statement into ObNodes.
Determine the state of a variable based on its type and storage class.
A node in the function's expression graph, and its edges to predecessors and successors.
Collect the state information.
Carries the state of a pointer variable.
Flow analysis for Ownership/Borrowing