Calculate arguments that can use references borrowed from the caller. When assigning to an argument, it no longer is borrowed.
(
blocks: list[BasicBlock], cfg: CFG, borrowed: set[Value]
)
| 418 | |
| 419 | |
| 420 | def analyze_borrowed_arguments( |
| 421 | blocks: list[BasicBlock], cfg: CFG, borrowed: set[Value] |
| 422 | ) -> AnalysisResult[Value]: |
| 423 | """Calculate arguments that can use references borrowed from the caller. |
| 424 | |
| 425 | When assigning to an argument, it no longer is borrowed. |
| 426 | """ |
| 427 | return run_analysis( |
| 428 | blocks=blocks, |
| 429 | cfg=cfg, |
| 430 | gen_and_kill=BorrowedArgumentsVisitor(borrowed), |
| 431 | initial=borrowed, |
| 432 | backward=False, |
| 433 | kind=MUST_ANALYSIS, |
| 434 | universe=borrowed, |
| 435 | ) |
| 436 | |
| 437 | |
| 438 | class UndefinedVisitor(BaseAnalysisVisitor[Value]): |
no test coverage detected
searching dependent graphs…