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

Class LoadMem

mypyc/ir/ops.py:1637–1662  ·  view source on GitHub ↗

Read a memory location: result = *(type *)src. Attributes: type: Type of the read value src: Pointer to memory to read

Source from the content-addressed store, hash-verified

1635
1636@final
1637class LoadMem(RegisterOp):
1638 """Read a memory location: result = *(type *)src.
1639
1640 Attributes:
1641 type: Type of the read value
1642 src: Pointer to memory to read
1643 """
1644
1645 error_kind = ERR_NEVER
1646
1647 def __init__(self, type: RType, src: Value, line: int = -1, *, borrow: bool = False) -> None:
1648 super().__init__(line)
1649 self.type = type
1650 # TODO: Support other native integer types
1651 assert is_pointer_rprimitive(src.type)
1652 self.src = src
1653 self.is_borrowed = borrow and type.is_refcounted
1654
1655 def sources(self) -> list[Value]:
1656 return [self.src]
1657
1658 def set_sources(self, new: list[Value]) -> None:
1659 (self.src,) = new
1660
1661 def accept(self, visitor: OpVisitor[T]) -> T:
1662 return visitor.visit_load_mem(self)
1663
1664
1665@final

Callers 3

load_memMethod · 0.90
test_load_memMethod · 0.90
var_object_sizeFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_load_memMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…