Add post-dominators#541
Conversation
jbj
left a comment
There was a problem hiding this comment.
Otherwise LGTM. Thanks for the PR.
|
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. |
|
@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 |
Adding support for post-dominators to the Dominance library.