| 163 | } |
| 164 | |
| 165 | uint32_t StructuredCFGAnalysis::LoopNestingDepth(uint32_t bb_id) { |
| 166 | uint32_t result = 0; |
| 167 | |
| 168 | // Find the merge block of the current loop as long as the block is inside a |
| 169 | // loop, exiting a loop for each iteration. |
| 170 | for (uint32_t merge_block_id = LoopMergeBlock(bb_id); merge_block_id != 0; |
| 171 | merge_block_id = LoopMergeBlock(merge_block_id)) { |
| 172 | result++; |
| 173 | } |
| 174 | |
| 175 | return result; |
| 176 | } |
| 177 | |
| 178 | uint32_t StructuredCFGAnalysis::SwitchMergeBlock(uint32_t bb_id) { |
| 179 | uint32_t header_id = ContainingSwitch(bb_id); |
no outgoing calls