Post-order traversal of the control flow graph. This also doubles as a reachability check to determine whether a basic block is reachable from any entry point.
| 15 | /// This also doubles as a reachability check to determine whether a basic block |
| 16 | /// is reachable from any entry point. |
| 17 | pub struct PostOrder { |
| 18 | /// Stack used to compute the post-order. |
| 19 | stack: Vec<(Visit, Block)>, |
| 20 | |
| 21 | /// List of basic blocks in CFG post-order. |
| 22 | postorder: Vec<Block>, |
| 23 | |
| 24 | /// Number of a basic block in the postorder traversal of the control |
| 25 | /// flow graph. This number is guranteed to be monotonically increasing for |
| 26 | /// each node of the graph but may not be contiguous. |
| 27 | /// |
| 28 | /// Unreahcable blocks get a value of `UNREACHABLE` (0). `SEEN` is used as a |
| 29 | /// marker during processing, but this is later replaced with the actual |
| 30 | /// number. |
| 31 | po_number: SecondaryMap<Block, u32>, |
| 32 | } |
| 33 | |
| 34 | /// Special value for `po_number` which indicates an unreachable block. |
| 35 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected