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

Function load_scc_from_cache

mypyc/codegen/emitmodule.py:470–485  ·  view source on GitHub ↗

Load IR for an SCC of modules from the cache. Arguments and return are as compile_scc_to_ir.

(
    scc: list[MypyFile], result: BuildResult, mapper: Mapper, ctx: DeserMaps
)

Source from the content-addressed store, hash-verified

468
469
470def load_scc_from_cache(
471 scc: list[MypyFile], result: BuildResult, mapper: Mapper, ctx: DeserMaps
472) -> ModuleIRs:
473 """Load IR for an SCC of modules from the cache.
474
475 Arguments and return are as compile_scc_to_ir.
476 """
477 cache_data = {
478 k.fullname: json.loads(
479 result.manager.metastore.read(get_state_ir_cache_name(result.graph[k.fullname]))
480 )["ir"]
481 for k in scc
482 }
483 modules = deserialize_modules(cache_data, ctx)
484 load_type_map(mapper, scc, ctx)
485 return modules
486
487
488def collect_source_dependencies(modules: dict[str, ModuleIR]) -> set[SourceDep]:

Callers 1

compile_modules_to_irFunction · 0.85

Calls 4

deserialize_modulesFunction · 0.90
load_type_mapFunction · 0.90
get_state_ir_cache_nameFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…