Unconditional jump.
| 395 | |
| 396 | @final |
| 397 | class Goto(ControlOp): |
| 398 | """Unconditional jump.""" |
| 399 | |
| 400 | error_kind = ERR_NEVER |
| 401 | |
| 402 | def __init__(self, label: BasicBlock, line: int = -1) -> None: |
| 403 | super().__init__(line) |
| 404 | self.label = label |
| 405 | |
| 406 | def targets(self) -> Sequence[BasicBlock]: |
| 407 | return (self.label,) |
| 408 | |
| 409 | def set_target(self, i: int, new: BasicBlock) -> None: |
| 410 | assert i == 0 |
| 411 | self.label = new |
| 412 | |
| 413 | def __repr__(self) -> str: |
| 414 | return "<Goto %s>" % self.label.label |
| 415 | |
| 416 | def sources(self) -> list[Value]: |
| 417 | return [] |
| 418 | |
| 419 | def set_sources(self, new: list[Value]) -> None: |
| 420 | assert not new |
| 421 | |
| 422 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 423 | return visitor.visit_goto(self) |
| 424 | |
| 425 | |
| 426 | @final |
no outgoing calls
searching dependent graphs…