Increase reference count (inc_ref src).
| 579 | |
| 580 | @final |
| 581 | class IncRef(RegisterOp): |
| 582 | """Increase reference count (inc_ref src).""" |
| 583 | |
| 584 | error_kind = ERR_NEVER |
| 585 | |
| 586 | def __init__(self, src: Value, line: int = -1) -> None: |
| 587 | assert src.type.is_refcounted |
| 588 | super().__init__(line) |
| 589 | self.src = src |
| 590 | |
| 591 | def sources(self) -> list[Value]: |
| 592 | return [self.src] |
| 593 | |
| 594 | def set_sources(self, new: list[Value]) -> None: |
| 595 | (self.src,) = new |
| 596 | |
| 597 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 598 | return visitor.visit_inc_ref(self) |
| 599 | |
| 600 | |
| 601 | @final |
no outgoing calls
searching dependent graphs…