pub struct GatherOutput<'a> {Show 14 fields
pub rir: &'a Rir,
pub interner: &'a ThreadedRodeo,
pub structs: HashMap<Spur, StructId>,
pub enums: HashMap<Spur, EnumId>,
pub functions: HashMap<Spur, FunctionInfo>,
pub methods: HashMap<(StructId, Spur), MethodInfo>,
pub constants: HashMap<Spur, ConstInfo>,
pub preview_features: PreviewFeatures,
pub builtin_string_id: Option<StructId>,
pub builtin_arch_id: Option<EnumId>,
pub builtin_os_id: Option<EnumId>,
pub builtin_typekind_id: Option<EnumId>,
pub type_pool: TypeInternPool,
pub param_arena: ParamArena,
}Expand description
Output from the declaration gathering phase.
This contains the state built during declaration gathering that is needed
for function body analysis. After gathering, this can be converted back
into a Sema for sequential analysis, or used to drive parallel analysis.
§Architecture
The separation of declaration gathering from body analysis enables:
- Parallel type checking - Each function can be analyzed independently
- Clearer architecture - Separation of concerns
- Foundation for incremental - Can cache SemaContext across compilations
- Better error recovery - One function’s error doesn’t block others
§Usage
// Option A: Simple path - all-in-one analysis
let sema = Sema::new(rir, interner, preview);
let output = sema.analyze_all()?;
// Option B: Parallel path (work in progress)
// Build SemaContext and analyze in parallel
let ctx = sema.build_sema_context();
let results: Vec<_> = functions.par_iter()
.map(|f| analyze_function_body(&ctx, f))
.collect();Fields§
§rir: &'a RirReference to the RIR being analyzed.
interner: &'a ThreadedRodeoReference to the string interner.
structs: HashMap<Spur, StructId>Struct lookup: maps struct name symbol to StructId.
enums: HashMap<Spur, EnumId>Enum lookup: maps enum name symbol to EnumId.
functions: HashMap<Spur, FunctionInfo>Function lookup: maps function name to info.
methods: HashMap<(StructId, Spur), MethodInfo>Method lookup: maps (struct_id, method_name) to info.
constants: HashMap<Spur, ConstInfo>Constant lookup: maps const name to info.
preview_features: PreviewFeaturesEnabled preview features.
builtin_string_id: Option<StructId>StructId of the synthetic String type.
builtin_arch_id: Option<EnumId>EnumId of the synthetic Arch enum (for @target_arch intrinsic).
builtin_os_id: Option<EnumId>EnumId of the synthetic Os enum (for @target_os intrinsic).
builtin_typekind_id: Option<EnumId>EnumId of the synthetic TypeKind enum (for @typeInfo intrinsic).
type_pool: TypeInternPoolType intern pool (ADR-0024 Phase 1).
param_arena: ParamArenaArena storage for function/method parameter data.