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

Class Register

mypyc/ir/ops.py:167–190  ·  view source on GitHub ↗

A Register holds a value of a specific type, and it can be read and mutated. A Register is always local to a function. Each local variable maps to a Register, and they are also used for some (but not all) temporary values. Note that the term 'register' is overloaded and is sometime

Source from the content-addressed store, hash-verified

165
166@final
167class Register(Value):
168 """A Register holds a value of a specific type, and it can be read and mutated.
169
170 A Register is always local to a function. Each local variable maps
171 to a Register, and they are also used for some (but not all)
172 temporary values.
173
174 Note that the term 'register' is overloaded and is sometimes used
175 to refer to arbitrary Values (for example, in RegisterOp).
176 """
177
178 def __init__(self, type: RType, name: str = "", is_arg: bool = False, line: int = -1) -> None:
179 self.type = type
180 self.name = name
181 self.is_arg = is_arg
182 self.is_borrowed = is_arg
183 self.line = line
184
185 @property
186 def is_void(self) -> bool:
187 return False
188
189 def __repr__(self) -> str:
190 return f"<Register {self.name!r} at {hex(id(self))}>"
191
192
193@final

Callers 15

gen_conditionMethod · 0.90
initMethod · 0.90
initMethod · 0.90
vec_createFunction · 0.90
vec_item_typeFunction · 0.90
vec_containsFunction · 0.90
faster_min_maxFunction · 0.90
any_all_helperFunction · 0.90
translate_sum_callFunction · 0.90
translate_next_callFunction · 0.90

Calls

no outgoing calls

Tested by 14

setUpMethod · 0.72
test_invalid_assignMethod · 0.72
test_duplicate_opMethod · 0.72
registerFunction · 0.72
add_localMethod · 0.72
test_assign_multiMethod · 0.72
test_long_unsignedMethod · 0.72
test_long_signedMethod · 0.72
test_extendMethod · 0.72
test_c_stringMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…