MCPcopy Index your code
hub / github.com/python/mypy / AssignMulti

Class AssignMulti

mypyc/ir/ops.py:351–381  ·  view source on GitHub ↗

Assign multiple values to a Register (dest = src1, src2, ...). This is used to initialize RArray values. It's provided to avoid very verbose IR for common vectorcall operations. Note that this interacts atypically with reference counting. We assume that each RArray register is init

Source from the content-addressed store, hash-verified

349
350@final
351class AssignMulti(BaseAssign):
352 """Assign multiple values to a Register (dest = src1, src2, ...).
353
354 This is used to initialize RArray values. It's provided to avoid
355 very verbose IR for common vectorcall operations.
356
357 Note that this interacts atypically with reference counting. We
358 assume that each RArray register is initialized exactly once
359 with this op.
360 """
361
362 error_kind = ERR_NEVER
363
364 def __init__(self, dest: Register, src: list[Value], line: int = -1) -> None:
365 super().__init__(dest, line)
366 assert src
367 assert isinstance(dest.type, RArray)
368 assert dest.type.length == len(src)
369 self.src = src
370
371 def sources(self) -> list[Value]:
372 return self.src.copy()
373
374 def set_sources(self, new: list[Value]) -> None:
375 self.src = new[:]
376
377 def stolen(self) -> list[Value]:
378 return []
379
380 def accept(self, visitor: OpVisitor[T]) -> T:
381 return visitor.visit_assign_multi(self)
382
383
384class ControlOp(Op):

Callers 2

setup_rarrayMethod · 0.90
test_assign_multiMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_assign_multiMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…