-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Join points at return? #14
Comments
It doesn’t currently, and it doesn’t need to, but that would be a good enhancement. Basically, we don’t have a lot of code using functions that affect permissions around control flow, and where we do, Ward already complains about it and it’s easy to refactor. Stuff like:
|
hmm. i'm not entirely convinced we'll always have conflicts if we just treat return as a fallthru. or perhaps we will but they might be difficult to understand. but it does look like the right thing would happen for things like lock/unlock, so i'm content to revisit this in the future. |
An easy hack would be to convert the graph to a tree by duplicating segments, maybe with sharing so there’s no actual copying:
(a → { b, c }, b → c) ⇒ (a & (c1 | b & c2))
But of course this doesn’t work with back-edges. |
It occurs to me that we could also decompose call trees into one “function” for each basic block. So the example you gave could be:
(Then during inference, some basic optimisations like TCO would show up: when we’re inferring a node in tail position, we wouldn’t need to add another stack frame.) |
Yea I think I basically agree with this. One property that we should have is that we enjoy an I'm not sure what you mean about TCO or stack frames |
Consider
I haven't looked too closely, but does
CallTree
represent the join point between thereturn
afterf2
and the fallthrough afterf3()
? Does it need to? (the usual representation for functions is a graph - not tree - of single-entry-single-exit basic blocks)The text was updated successfully, but these errors were encountered: