| 942 | |
| 943 | |
| 944 | void CFG::edge_iterator::next() { |
| 945 | // jump to next BB with a terminator that is a jump |
| 946 | while (true) { |
| 947 | if (bbi == bbe) |
| 948 | return; |
| 949 | |
| 950 | if (!(*bbi)->empty()) { |
| 951 | if (auto instr = dynamic_cast<JumpInstr*>(&(*bbi)->back())) { |
| 952 | ti = instr->targets().begin(); |
| 953 | te = instr->targets().end(); |
| 954 | return; |
| 955 | } |
| 956 | } |
| 957 | ++bbi; |
| 958 | } |
| 959 | } |
| 960 | |
| 961 | CFG::edge_iterator::edge_iterator(vector<BasicBlock*>::iterator &&it, |
| 962 | vector<BasicBlock*>::iterator &&end) |