Native call f(arg, ...). The call target can be a module-level function or a class.
| 629 | |
| 630 | @final |
| 631 | class Call(RegisterOp): |
| 632 | """Native call f(arg, ...). |
| 633 | |
| 634 | The call target can be a module-level function or a class. |
| 635 | """ |
| 636 | |
| 637 | def __init__(self, fn: FuncDecl, args: Sequence[Value], line: int) -> None: |
| 638 | self.fn = fn |
| 639 | self.args = list(args) |
| 640 | assert len(self.args) == len(fn.sig.args) |
| 641 | self.type = fn.sig.ret_type |
| 642 | ret_type = fn.sig.ret_type |
| 643 | if not ret_type.error_overlap: |
| 644 | self.error_kind = ERR_MAGIC |
| 645 | else: |
| 646 | self.error_kind = ERR_MAGIC_OVERLAPPING |
| 647 | super().__init__(line) |
| 648 | |
| 649 | def sources(self) -> list[Value]: |
| 650 | return list(self.args.copy()) |
| 651 | |
| 652 | def set_sources(self, new: list[Value]) -> None: |
| 653 | self.args = new[:] |
| 654 | |
| 655 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 656 | return visitor.visit_call(self) |
| 657 | |
| 658 | |
| 659 | @final |
no outgoing calls
searching dependent graphs…