Data flow: Rework SummarizedCallable::clearsContent/2
#6777
+957
−311
Conversation
43b2084
to
e7059fa
e7059fa
to
6a4e2a6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


This PR reworks how we interpret
SummarizedCallable::clearsContent(int i, Content c). Before this PR, we would insert content-clearing at the relevant argument nodes to a summarized callable. However, that does not work when we want to model a callable that consumes some content, that is, both reads from the contents and afterwards clears it, since clearing at the argument would not allow for reading the content inside the summarized callable.This PR instead synthesizes two new nodes inside the callable:
where
pis theith parameter node for the callable. Content-clearing is inserted atsynth1, andsynth1becomes a post-update node forsynth2. This effectively allows for flow intopand back out again, but only if data is not stored in the relevant content. (We could in principle have avoidedsynth2and makesynth1a post-update node forp, but that may break the invariant that each node has at most one post-update node).The above only works, however, if flow at calls to the summarized callable does not skip over the argument. Example
In the above, flow should not pass from
aon the first line (or the second line) toaon the third line. Instead, the flow summary will allow for flow fromaon line 2 to the post-update node foraon that line, and from there use-use flow toaon the third line.The text was updated successfully, but these errors were encountered: