pub struct CodegenContext {Show 14 fields
pub items: Vec<TopLevel>,
pub fn_sigs: HashMap<String, (Vec<Type>, Type, Vec<String>)>,
pub memo_fns: HashSet<String>,
pub memo_safe_types: HashSet<String>,
pub type_defs: Vec<TypeDef>,
pub fn_defs: Vec<FnDef>,
pub project_name: String,
pub modules: Vec<ModuleInfo>,
pub module_prefixes: HashSet<String>,
pub policy: Option<ProjectConfig>,
pub emit_replay_runtime: bool,
pub runtime_policy_from_env: bool,
pub guest_entry: Option<String>,
pub emit_self_host_runtime: bool,
}Expand description
Collected context from the Aver program, shared across all backends.
Fields§
§items: Vec<TopLevel>All top-level items (post-TCO transform, post-typecheck).
fn_sigs: HashMap<String, (Vec<Type>, Type, Vec<String>)>Function signatures: name → (param_types, return_type, effects).
memo_fns: HashSet<String>Functions eligible for auto-memoization.
memo_safe_types: HashSet<String>Set of type names whose values are memo-safe.
type_defs: Vec<TypeDef>User-defined type definitions (for struct/enum generation).
fn_defs: Vec<FnDef>User-defined function definitions.
project_name: StringProject/binary name.
modules: Vec<ModuleInfo>Dependent modules loaded for inlining.
module_prefixes: HashSet<String>Set of module prefixes for qualified name resolution (e.g. “Models.User”).
policy: Option<ProjectConfig>Embedded runtime policy from aver.toml for generated code.
emit_replay_runtime: boolEmit generated scoped runtime support (replay and/or runtime-loaded policy).
runtime_policy_from_env: boolLoad runtime policy from the active module root instead of embedding it.
guest_entry: Option<String>Explicit guest entry boundary for scoped replay/policy.
emit_self_host_runtime: boolEmit extra generated helpers needed by the cached self-host runtime.