Skip to main content

build_context

Function build_context 

Source
pub fn build_context(
    items: Vec<TopLevel>,
    tc_result: &TypeCheckResult,
    entry_analysis: Option<&AnalysisResult>,
    memo_fns: HashSet<String>,
    project_name: String,
    modules: Vec<ModuleInfo>,
) -> CodegenContext
Expand description

Build a CodegenContext from parsed + type-checked items.

entry_analysis is the analyze stage output for items (entry module). When provided, codegen reads mutual_tco_members, recursive_fns, and per-fn FnAnalysis from it instead of recomputing. Each ModuleInfo in modules carries its own per-module analysis; codegen unions the per-module sets to build a global view (sound under Aver’s module DAG invariant — no cross-module SCCs possible, see src/ir/analyze.rs doc).