vast
vast copied to clipboard
Implement APIs to easily access control-flow targets
Prerequisites
- [X] I have read the documentation and the proposed feature is not implemented.
Description
Some control-flow altering operations, e.g. GotoStmt
, do not provide any methods to know the targets of their flows. This is in contrast to something like SwitchOp
, which provides a getCases
method. This issue requests that all control-flow altering operations provide an API to get the relevant control-flow targets. If possible, having a more generic trait that provides generic access to the successors would also be nice.
Since in high level we do not have blocks, what is the ideal returned value? Next operation to be executed?
An addendum is that there should also be APIs to find predecessors, e.g. to LabelDeclOp
s (or maybe LabelStmt
?). Ditto for cases.
Since in high level we do not have blocks, what is the ideal returned value? Next operation to be executed?
Yes, the next operation to execute would be the most logical thing, I think, as there are no guarantees that things are block/region entrypoints.