(inputs: list[parser.InputEffect])
| 422 | |
| 423 | |
| 424 | def analyze_caches(inputs: list[parser.InputEffect]) -> list[CacheEntry]: |
| 425 | caches: list[parser.CacheEffect] = [ |
| 426 | i for i in inputs if isinstance(i, parser.CacheEffect) |
| 427 | ] |
| 428 | if caches: |
| 429 | # Middle entries are allowed to be unused. Check first and last caches. |
| 430 | for index in (0, -1): |
| 431 | cache = caches[index] |
| 432 | if cache.name == "unused": |
| 433 | position = "First" if index == 0 else "Last" |
| 434 | msg = f"{position} cache entry in op is unused. Move to enclosing macro." |
| 435 | raise analysis_error(msg, cache.tokens[0]) |
| 436 | return [CacheEntry(i.name, int(i.size)) for i in caches] |
| 437 | |
| 438 | |
| 439 | def find_variable_stores(node: parser.InstDef) -> list[lexer.Token]: |
no test coverage detected
searching dependent graphs…