Skip to content

Conversation

@kevinbackhouse
Copy link
Contributor

Adding support for post-dominators to the Dominance library.

@kevinbackhouse kevinbackhouse requested a review from a team as a code owner November 24, 2018 18:25
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM. Thanks for the PR.

@aschackmull
Copy link
Contributor

If there are exception edges reaching the exit-node, then what's usually needed when reasoning about post-dominance is post-dominance under the assumption of normal termination of the enclosing function. This can be achieved by adding another exit-node to the cfg that collects normal return edges before joining exception edges at the final exit-node and calculating post-dominance based on that instead. This might not be very relevant for C++, but I've been thinking about adding this additional notion of post-dominance to the java libs, since regular post-dominance doesn't work well there.

@kevinbackhouse
Copy link
Contributor Author

@aschackmull: my main use-case for this is to check that something is cleaned up before the function exits. For example, checking that a mutex is always unlocked before the function exits. Or checking that a file descriptor is always closed before the function exits. So I think I would want to include things like exception edges. But perhaps not things like calls to exit/abort because it's not such a big deal if the program is going to terminate anyway.

@jbj jbj merged commit c403bb1 into github:master Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants