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

Function all_values_full

mypyc/ir/func_ir.py:379–402  ·  view source on GitHub ↗

Return set of all values that are initialized or accessed.

(args: list[Register], blocks: list[BasicBlock])

Source from the content-addressed store, hash-verified

377
378
379def all_values_full(args: list[Register], blocks: list[BasicBlock]) -> list[Value]:
380 """Return set of all values that are initialized or accessed."""
381 values: list[Value] = list(args)
382 seen_registers = set(args)
383
384 for block in blocks:
385 for op in block.ops:
386 for source in op.sources():
387 # Look for uninitialized registers that are accessed. Ignore
388 # non-registers since we don't allow ops outside basic blocks.
389 if isinstance(source, Register) and source not in seen_registers:
390 values.append(source)
391 seen_registers.add(source)
392 if not isinstance(op, ControlOp):
393 if isinstance(op, (Assign, AssignMulti)):
394 if op.dest not in seen_registers:
395 values.append(op.dest)
396 seen_registers.add(op.dest)
397 elif op.is_void:
398 continue
399 else:
400 values.append(op)
401
402 return values
403
404
405_ARG_KIND_TO_INSPECT: Final = {

Callers 1

format_registersFunction · 0.90

Calls 6

listClass · 0.85
setClass · 0.85
isinstanceFunction · 0.85
appendMethod · 0.80
sourcesMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…