MCPcopy Create free account
hub / github.com/python/mypy / SetMem

Class SetMem

mypyc/ir/ops.py:1666–1694  ·  view source on GitHub ↗

Write to a memory location: *(type *)dest = src Attributes: type: Type of the written value dest: Pointer to memory to write src: Source value

Source from the content-addressed store, hash-verified

1664
1665@final
1666class SetMem(Op):
1667 """Write to a memory location: *(type *)dest = src
1668
1669 Attributes:
1670 type: Type of the written value
1671 dest: Pointer to memory to write
1672 src: Source value
1673 """
1674
1675 error_kind = ERR_NEVER
1676
1677 def __init__(self, type: RType, dest: Value, src: Value, line: int = -1) -> None:
1678 super().__init__(line)
1679 self.type = void_rtype
1680 self.dest_type = type
1681 self.src = src
1682 self.dest = dest
1683
1684 def sources(self) -> list[Value]:
1685 return [self.src, self.dest]
1686
1687 def set_sources(self, new: list[Value]) -> None:
1688 self.src, self.dest = new
1689
1690 def stolen(self) -> list[Value]:
1691 return [self.src]
1692
1693 def accept(self, visitor: OpVisitor[T]) -> T:
1694 return visitor.visit_set_mem(self)
1695
1696
1697@final

Callers 4

gen_returnMethod · 0.90
set_memMethod · 0.90
test_set_memMethod · 0.90
buf_init_itemFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_set_memMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…