dest = (reg, ...) (for fixed-length tuple)
| 1047 | |
| 1048 | @final |
| 1049 | class TupleSet(RegisterOp): |
| 1050 | """dest = (reg, ...) (for fixed-length tuple)""" |
| 1051 | |
| 1052 | error_kind = ERR_NEVER |
| 1053 | |
| 1054 | def __init__(self, items: list[Value], line: int) -> None: |
| 1055 | super().__init__(line) |
| 1056 | self.items = items |
| 1057 | # Don't keep track of the fact that an int is short after it |
| 1058 | # is put into a tuple, since we don't properly implement |
| 1059 | # runtime subtyping for tuples. |
| 1060 | self.tuple_type = RTuple( |
| 1061 | [ |
| 1062 | arg.type if not is_short_int_rprimitive(arg.type) else int_rprimitive |
| 1063 | for arg in items |
| 1064 | ] |
| 1065 | ) |
| 1066 | self.type = self.tuple_type |
| 1067 | |
| 1068 | def sources(self) -> list[Value]: |
| 1069 | return self.items.copy() |
| 1070 | |
| 1071 | def stolen(self) -> list[Value]: |
| 1072 | return self.items.copy() |
| 1073 | |
| 1074 | def set_sources(self, new: list[Value]) -> None: |
| 1075 | self.items = new[:] |
| 1076 | |
| 1077 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 1078 | return visitor.visit_tuple_set(self) |
| 1079 | |
| 1080 | |
| 1081 | @final |
no outgoing calls
no test coverage detected
searching dependent graphs…