| 3214 | } |
| 3215 | |
| 3216 | JumpInstr::target_iterator JumpInstr::it_helper::end() const { |
| 3217 | unsigned idx; |
| 3218 | if (!instr) { |
| 3219 | idx = 0; |
| 3220 | } else if (auto br = dynamic_cast<const Branch*>(instr)) { |
| 3221 | idx = br->getFalse() ? 2 : 1; |
| 3222 | } else if (auto sw = dynamic_cast<const Switch*>(instr)) { |
| 3223 | idx = sw->getNumTargets() + 1; |
| 3224 | } else { |
| 3225 | UNREACHABLE(); |
| 3226 | } |
| 3227 | return { instr, idx }; |
| 3228 | } |
| 3229 | |
| 3230 | bool JumpInstr::isTerminator() const { |
| 3231 | return true; |