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

Class BorrowedArgumentsVisitor

mypyc/analysis/dataflow.py:392–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390
391
392class BorrowedArgumentsVisitor(BaseAnalysisVisitor[Value]):
393 def __init__(self, args: set[Value]) -> None:
394 self.args = args
395
396 def visit_branch(self, op: Branch) -> GenAndKill[Value]:
397 return _EMPTY
398
399 def visit_return(self, op: Return) -> GenAndKill[Value]:
400 return _EMPTY
401
402 def visit_unreachable(self, op: Unreachable) -> GenAndKill[Value]:
403 return _EMPTY
404
405 def visit_register_op(self, op: RegisterOp) -> GenAndKill[Value]:
406 return _EMPTY
407
408 def visit_assign(self, op: Assign) -> GenAndKill[Value]:
409 if op.dest in self.args:
410 return set(), {op.dest}
411 return _EMPTY
412
413 def visit_assign_multi(self, op: AssignMulti) -> GenAndKill[Value]:
414 return _EMPTY
415
416 def visit_set_mem(self, op: SetMem) -> GenAndKill[Value]:
417 return _EMPTY
418
419
420def analyze_borrowed_arguments(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…