Skip to content

v.transform #

Bounds checks of a[i] in for i in low .. a.len { ... }.

When low is a non-negative literal, a is an immutable local array or string and the loop body cannot write a or i, every a[i] evaluated by the body has low <= i < a.len: the condition i < a.len is checked before each iteration, and nothing can change a.len or i until the next one. Such reads are marked with node_flag_in_range_index, and cgen omits their bounds check.

Constants #

const option_unwrap_marker = '?opt'

option_unwrap_marker tags a SmartcastContext produced by an x != none condition: variant_name holds the option's base type and the access is lowered to the option's .value field instead of a sum union field.

fn erase_generic_templates #

fn erase_generic_templates(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool) map[string]bool

erase_generic_templates removes generic templates that no longer need to remain in the transformed AST.

fn materialize_inferred_anonymous_structs_before_prepare #

fn materialize_inferred_anonymous_structs_before_prepare(mut a flat.FlatAst, tc &types.TypeChecker) bool

materialize_inferred_anonymous_structs_before_prepare gives unresolved anonymous struct literals concrete types before reusable transform indexes are built.

fn monomorphize_with_used #

fn monomorphize_with_used(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool) map[string]bool

monomorphize_with_used specializes generic declarations using the supplied used-function set.

fn monomorphize_with_used_checked #

fn monomorphize_with_used_checked(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool) (map[string]bool, []string)

monomorphize_with_used_checked also reports semantic errors that can only be resolved after generic parameters have concrete types.

fn monomorphize_with_used_checked_config #

fn monomorphize_with_used_checked_config(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, parallel bool) (map[string]bool, []string)

monomorphize_with_used_checked_config controls whether independent generic specializations can be cloned concurrently.

fn monomorphize_with_used_checked_config_scoped #

fn monomorphize_with_used_checked_config_scoped(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, parallel bool, stage_scope voidptr) (map[string]bool, []string)

monomorphize_with_used_checked_config_scoped keeps transient specialization state in stage_scope while promoting escaping AST payloads directly to its parent arena.

fn monomorphize_with_used_checked_config_scoped_cached #

fn monomorphize_with_used_checked_config_scoped_cached(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, parallel bool, stage_scope voidptr, cached_specs []MonomorphCacheSpec, after_transform bool) (map[string]bool, []string, []MonomorphCacheSpec)

monomorphize_with_used_checked_config_scoped_cached restores concrete generic signatures from cached_specs and returns the complete specialization set. A restored signature rewrites current program calls normally, while its unchanged dependency body can remain in the persistent compiled prefix. after_transform tells that the tree went through the transform stage, which settled the body of every function that used_fns names: it lowered the body, or, in an incremental rebuild, left it to the cached build. Only the functions that a specialization makes reachable are then lowered here. A check monomorphizes the tree as it was parsed and passes false.

fn prepare_selfhost_transform #

fn prepare_selfhost_transform(a &flat.FlatAst, tc &types.TypeChecker, enabled bool) &PreparedSelfhostTransform

prepare_selfhost_transform builds the immutable transform indexes on a helper-local arena. The caller keeps the returned value alive until transform_prepared_selfhost_owned consumes it.

fn promote_scoped_checker_node_caches_parallel #

fn promote_scoped_checker_node_caches_parallel(mut tc types.TypeChecker, a &flat.FlatAst, scope voidptr, generated_start int) bool

promote_scoped_checker_node_caches_parallel runs the per-id loops of the checker node-cache promotion over the shared worker pool. Returns false when no pool is available so the caller can run them serially instead.

fn promote_scoped_texts_parallel #

fn promote_scoped_texts_parallel(mut a flat.FlatAst, scope voidptr) bool

promote_scoped_texts_parallel publishes every transform-scope-owned node text over the shared worker pool, replacing the serial canonicalize + promote pair for builds without retained regions. Returns false when no pool is available so the caller can run the serial walks instead.

fn register_cached_monomorph_signatures #

fn register_cached_monomorph_signatures(a &flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, cached_specs []MonomorphCacheSpec)

register_cached_monomorph_signatures installs persistent concrete signatures and their named signature types before the disposable monomorphization arena is entered.

fn reserve_parallel_transform_ast #

fn reserve_parallel_transform_ast(mut a flat.FlatAst, skip_generics bool)

reserve_parallel_transform_ast reserves persistent append regions before a disposable transform arena is entered.

fn reserve_parallel_transform_ast_before_monomorph #

fn reserve_parallel_transform_ast_before_monomorph(mut a flat.FlatAst, skip_generics bool)

reserve_parallel_transform_ast_before_monomorph is reserve_parallel_transform_ast for a build that monomorphizes after the transform stage. It also reserves the specializer's headroom past the lowered tree; grown later, the whole lowered tree would be copied again.

fn reserve_parallel_transform_cache_ast #

fn reserve_parallel_transform_cache_ast(mut a flat.FlatAst, skip_generics bool)

reserve_parallel_transform_cache_ast adds overflow headroom for cache population, which transforms every module body rather than just the program-reachable subset.

fn scan_scoped_text_flags_parallel #

fn scan_scoped_text_flags_parallel(a &flat.FlatAst, scope voidptr, mut flags []u8) bool

scan_scoped_text_flags_parallel fills flags (one byte per node id in [0, flags.len)) for nodes whose text is owned by scope, using the shared worker pool. Returns false when no pool is available so the caller can walk every node serially instead.

fn scan_scoped_text_flags_parallel_multi #

fn scan_scoped_text_flags_parallel_multi(a &flat.FlatAst, scopes []voidptr, mut flags []u8) bool

scan_scoped_text_flags_parallel_multi flags every node whose text is owned by any of scopes.

fn sum_eq_helper_name #

fn sum_eq_helper_name(sum_name string) string

sum_eq_helper_name is the global C-level name of the synthesized deep-equality helper for a sum type.

fn transform #

fn transform(mut a flat.FlatAst, tc &types.TypeChecker)

transform supports transform handling for transform.

fn transform_prepared_selfhost_owned #

fn transform_prepared_selfhost_owned(mut prepared PreparedSelfhostTransform, mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, stage_scope voidptr) (map[string]bool, bool, []string, []int, []ScopedTransformRegion)

transform_prepared_selfhost_owned completes a self-host transform whose immutable indexes were prepared concurrently with markused.

fn transform_selected_functions #

fn transform_selected_functions(mut a flat.FlatAst, tc &types.TypeChecker, selected map[string]bool) (map[string]bool, []string, []string)

transform_selected_functions lowers only the named function bodies after the incremental driver has proved that declarations and every other body are unchanged. Whole-program interface and comptime scans remain lazy: lowering a selected body still triggers them if that body actually needs the metadata. It also returns synthesized helper names that incremental Cgen must emit.

fn transform_with_used #

fn transform_with_used(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool) map[string]bool

transform_with_used transforms transform with used data for transform.

fn transform_with_used_opt #

fn transform_with_used_opt(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, want_parallel bool) (map[string]bool, bool)

transform_with_used_opt is transform_with_used with an opt-in for parallel function-body transform. It returns the augmented used-fn set and whether the function bodies were actually transformed across threads (false when parallel was not requested, the build lacks thread support, or there was too little work).

fn transform_with_used_opt_config #

fn transform_with_used_opt_config(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, want_parallel bool, skip_generics bool) (map[string]bool, bool)

transform_with_used_opt_config is transform_with_used_opt with extra pipeline switches for self-host builds.

fn transform_with_used_opt_config_scoped_workers #

fn transform_with_used_opt_config_scoped_workers(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, want_parallel bool, skip_generics bool, scope_parallel_workers bool) (map[string]bool, bool)

transform_with_used_opt_config_scoped_workers optionally gives parallel helpers disposable prealloc arenas. It is used by prealloc self-host builds to retain parallel latency without retaining every helper's scratch memory.

fn transform_with_used_opt_config_scoped_workers_checked #

fn transform_with_used_opt_config_scoped_workers_checked(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, want_parallel bool, skip_generics bool, scope_parallel_workers bool, building_v bool) (map[string]bool, bool, []string)

transform_with_used_opt_config_scoped_workers_checked also returns diagnostics selected while normal comptime reflection loops are unrolled.

fn transform_with_used_opt_config_scoped_workers_checked_owned #

fn transform_with_used_opt_config_scoped_workers_checked_owned(mut a flat.FlatAst, tc &types.TypeChecker, used_fns map[string]bool, want_parallel bool, skip_generics bool, scope_parallel_workers bool, building_v bool, stage_scope voidptr) (map[string]bool, bool, []string, []int, []ScopedTransformRegion)

transform_with_used_opt_config_scoped_workers_checked_owned additionally reports source AST nodes whose owned payloads were replaced during a scoped transform, so the driver can promote exactly those escaping values.

struct FieldInfo #

struct FieldInfo {
pub:
	name         string
	typ          u32
	raw_typ      u32
	default_expr flat.NodeId
	is_embedded  bool
}

FieldInfo stores field info metadata used by transform.

fn (FieldInfo) typ_text #

@[inline]
fn (value &FieldInfo) typ_text() string

typ_text resolves the indexed source type spelling.

fn (FieldInfo) raw_typ_text #

@[inline]
fn (value &FieldInfo) raw_typ_text() string

raw_typ_text resolves the indexed source type spelling.

struct MonomorphCacheSpec #

struct MonomorphCacheSpec {
pub:
	decl_key string
	module   string
	args     flat.TypeTextList
}

MonomorphCacheSpec identifies one concrete generic function body. Dependency specialization caches use it to restore signatures without cloning unchanged module templates into the program AST.

fn (MonomorphCacheSpec) args_text #

fn (value &MonomorphCacheSpec) args_text() []string

args_text resolves concrete type arguments at a text integration boundary.

struct PreparedSelfhostTransform #

@[heap]
struct PreparedSelfhostTransform {
mut:
	transformer Transformer
	scope       voidptr
	ready       bool
	// keeps_scope_without_regions is set when the caller keeps the whole transform
	// arena alive unless workers retained separate regions. The list of
	// scope-owned base nodes is then only needed when such regions exist.
	keeps_scope_without_regions bool
}

PreparedSelfhostTransform owns the read-only transformer indexes built while markused walks the same checked AST on the driver thread.

fn (PreparedSelfhostTransform) set_keeps_scope_without_regions #

fn (mut p PreparedSelfhostTransform) set_keeps_scope_without_regions(keeps bool)

set_keeps_scope_without_regions tells the transform that the caller keeps its arena when no worker regions are retained (see keeps_scope_without_regions).

fn (PreparedSelfhostTransform) take_prescan_scopes #

fn (mut prepared PreparedSelfhostTransform) take_prescan_scopes() []voidptr

take_prescan_scopes transfers the pre-scan helper arenas to the driver. They back index tables and possibly lowered node text, so they are released only together with the preparation arena.

fn (PreparedSelfhostTransform) take_scope #

fn (mut prepared PreparedSelfhostTransform) take_scope() voidptr

take_scope transfers ownership of the preparation arena to the driver. The arena can back lowered AST text, so it must remain alive through codegen.

struct ScopedTransformRegion #

struct ScopedTransformRegion {
pub:
	scope      voidptr
	new_start  int
	new_end    int
	base_nodes []int
}

ScopedTransformRegion describes AST payloads owned by one retained worker arena. The driver canonicalizes this region before releasing the arena.

struct SmartcastContext #

struct SmartcastContext {
pub:
	type_texts    &flat.TypeTextTable = unsafe { nil }
	expr_name     string // the expression being smartcast (e.g. "node")
	variant_name  u32    // the variant type name (e.g. "Ident")
	sum_type_name u32    // the parent sum type name (e.g. "Expr")
	display_type  u32    // debugger-visible type for aggregate match branches
}

SmartcastContext stores smartcast context state used by transform.

fn (SmartcastContext) variant_name_text #

@[inline]
fn (sc &SmartcastContext) variant_name_text() string

variant_name_text resolves the indexed smartcast type spelling.

fn (SmartcastContext) sum_type_name_text #

@[inline]
fn (sc &SmartcastContext) sum_type_name_text() string

sum_type_name_text resolves the indexed smartcast type spelling.

fn (SmartcastContext) display_type_text #

@[inline]
fn (sc &SmartcastContext) display_type_text() string

display_type_text resolves the indexed smartcast type spelling.

struct StructInfo #

struct StructInfo {
pub:
	name       u32
	module     string
	is_params  bool
	is_aligned bool
	is_c_anon  bool
	alignment  string
	fields     []FieldInfo
mut:
	field_indices map[string]int
}

StructInfo stores struct info metadata used by transform.

fn (StructInfo) name_text #

fn (info &StructInfo) name_text() string

name_text resolves the stored type name at a textual boundary.

struct SumEqRequest #

struct SumEqRequest {
pub:
	sum_name      u32
	struct_name   u32
	module        string
	file          string
	helper_module string
}

SumEqRequest records where a sum or recursive struct equality helper was first requested, so the helper body is built under that module/file resolution context. The helper module can differ for program-specific generic specializations, whose generated functions and helpers must stay in the main cache segment.

fn (SumEqRequest) struct_name_text #

@[inline]
fn (value &SumEqRequest) struct_name_text() string

struct_name_text resolves the indexed source type spelling.

fn (SumEqRequest) sum_name_text #

@[inline]
fn (value &SumEqRequest) sum_name_text() string

sum_name_text resolves the indexed source type spelling.

struct Transformer #

struct Transformer {
mut:
	a                             &flat.FlatAst      = unsafe { nil }
	tc                            &types.TypeChecker = unsafe { nil }
	structs                       map[u32]StructInfo
	embedded_fields               map[u32][]FieldInfo
	struct_short_name_index       flat.SourceTypeBindings
	struct_short_name_index_ready bool
	non_main_type_short_names     map[u32]bool
	non_main_type_index_ready     bool
	unique_fields                 flat.TypeTextBindings
	alias_methods                 map[u32]map[string]string
	alias_method_candidates       map[string][]string
	alias_method_candidates_ready bool
	globals                       flat.TypeTextBindings
	global_qualified_names        map[string][]string
	sum_types                     flat.SourceTypeListBindings
	sum_variant_parents           map[u32][]u32
	sum_variant_names             map[u32]bool
	sum_variant_fields            flat.TypeTextBindings
	qualified_types               flat.SourceTypeBindings
	fn_ret_types                  flat.TypeTextBindings
	fn_ret_types_by_module        flat.TypeTextBindings
	fn_ret_types_log              []string
	tc_signature_names_log        []string
	generated_capture_contexts    []string
	struct_maps_shared            bool
	multi_return_fn_ret_types     map[string][]types.Type
	receiver_method_suffix_index  map[string]string
	declared_fn_name_counts       map[string]u8
	variadic_suffix_index         map[string]i8
	const_selector_filter         &ConstSelectorNameFilter = unsafe { nil }
	const_suffixes                map[string]string
	source_parent_ids             []i32
	shared_local_decl_names       map[string]bool
	has_shared_decls              bool            // any `shared` variable, parameter, global or field, see shared_map_autolock_possible
	shared_field_names            map[string]bool // names of `shared` fields and globals
	// const_array_fixed_storage_ready marks the cache below as fully populated
	// (by the overlapped pre-dispatch scan), making the precompute a no-op.
	const_array_fixed_storage_ready bool
	// defer_pre_scan_indexes routes the AST/tc-only index builders in prepare()
	// to the overlapped pre-scan helper thread (see prepare_with_pre_scans).
	defer_pre_scan_indexes bool
	// Fixed-array summaries can reuse the completed parameter pre-scan cache.
	defer_fixed_array_borrow_prep bool
	// fixed_array_borrow_node_count is the node count the summaries cover.
	fixed_array_borrow_node_count int
	// borrow_params_after_transform starts the summaries from the transform
	// stage's (see prepare_fixed_array_borrow_params).
	borrow_params_after_transform bool
	// merge_regions_relocated marks worker regions as already id-relocated in
	// place (parallel pass), so merge_worker compacts with plain memmoves.
	merge_regions_relocated bool
	// merge_call_canon holds, in fork_overlay.resolved_call_names iteration
	// order, each name's canonical spelling looked up in parallel before the
	// merge ('' when the name was not interned yet).
	merge_call_canon []string
	// merge_regions_absorbed marks worker regions as already relocated *into*
	// their final master slots by that same parallel pass, so merge_worker skips
	// the bulk copies entirely and shifts ids with the offsets recorded below.
	merge_regions_absorbed bool
	// merge_before_join marks a merge_worker call made while other helpers still
	// run: the master arrays have not reached their final length yet.
	merge_before_join          bool
	merge_absorbed_node_shift  i32
	merge_absorbed_child_shift i32
	// const_array_fixed_storage_cache avoids rescanning the complete AST for
	// repeated uses of the same array constant in one transform worker.
	const_array_fixed_storage_cache     map[string]i8
	enum_selector_filter                &EnumSelectorNameFilter = unsafe { nil }
	enum_unqualified_index              &EnumUnqualifiedIndex   = unsafe { nil }
	enum_types                          map[u32][]string
	enum_explicit_first_values          map[u32]bool // the first member has a value, maybe not 0
	enum_backing_types                  flat.SourceTypeBindings
	cur_file                            string
	cur_module                          string
	cur_fn_name                         string
	cur_fn_source_file                  string
	cur_fn_source_module                string
	cur_fn_receiver_name                u32
	cur_fn_ret_type                     u32
	cur_fn_is_generic                   bool
	cur_fn_manualfree                   bool
	cur_fn_value_semantics              bool // standard library body that keeps V's value semantics under -ownership
	literal_free_fn_body                bool // work item is proven to contain no closure literals
	cur_fn_variadic_param               string
	skip_generics                       bool
	building_v                          bool
	var_types                           []VarTypeBinding
	var_type_texts                      &flat.TypeTextTable = &flat.TypeTextTable{}
	comptime_scalar_locals              map[string]ComptimeStringScalar
	comptime_array_locals               map[string][]ComptimeStringScalar
	comptime_array_locals_shared        bool
	comptime_scalar_locals_shared       bool
	cur_stmt_list                       []flat.NodeId // the statement list being transformed
	var_type_indices                    map[string]int
	var_type_cache                      &VarTypeIndexCache = unsafe { nil }
	refined_node_types                  map[int]u32
	fn_value_locals                     map[string]string
	mut_param_values                    map[string]bool
	fixed_array_param_values            map[string]bool
	mut_value_ident_nodes               map[int]bool
	ordering_snapshot_names             map[string]bool
	assert_watch                        AssertOperandWatch
	pointer_value_lvalues               map[string]bool
	pointer_value_rvalues               map[string]bool
	fixed_array_value_rvalues           map[string]bool
	addr_lvalue_pointer_locals          map[string]bool
	orm_initialized_fields              map[string][]string
	sql_tracking_disabled               bool // complete program scan found no SQL expressions
	sql_query_data_aliases              map[string][]string
	sql_array_it_name                   string
	bound_method_arrays                 map[string]BoundMethodArrayInfo
	temp_counter                        int
	global_temp_counter                 int
	pending_stmts                       []flat.NodeId
	smartcast_stack                     []SmartcastContext
	generic_typeof_smartcasts           []SmartcastContext // narrowings of the generic body being cloned, for its `typeof` fold
	invalidated_smartcasts              map[string]bool
	smartcast_event_id                  int
	smartcast_invalidation_event_ids    map[string]int
	smartcast_reestablishment_event_ids map[string]int
	in_call_callee                      bool
	in_monomorphize_scan                bool
	validating_generic_spec             bool
	fn_body_locals_in_scope             bool
	allow_comptime_enum_int_assign      bool
	monomorph_errors                    []string
	monomorph_error_seen                map[string]bool
	in_spawn_expr                       bool
	has_spawn_expr                      bool
	discarded_aggregate_spawns          map[int]bool
	in_const_init                       bool
	in_return_expr                      bool
	expected_expr_node                  int = -1
	expected_expr_type                  u32
	in_selector_base                    bool
	// Set while transforming the base of a bound-method-value selector, where a
	// `first()`/`last()` accessor base must keep its copying semantics instead of being
	// borrowed in place (see borrow_first_last_accessor / transform_selector_expr).
	suppress_first_last_accessor_borrow bool

	autolock_depth                         int
	shared_map_read_locks                  map[int]flat.NodeId // reads of `shared` maps -> the map they read-lock, see try_autolock_shared_map_read
	shared_map_read_ids                    []int
	shared_map_reads_stmt                  flat.NodeId                = -1
	alias_cache                            &AliasCache                = unsafe { nil }
	sum_cache                              &AliasCache                = unsafe { nil }
	module_type_cache                      &ModuleTypeCache           = unsafe { nil }
	enum_selector_cache                    &EnumSelectorCache         = unsafe { nil }
	struct_guess_cache                     &AliasCache                = unsafe { nil }
	generic_unresolved_cache               &GenericUnresolvedCache    = unsafe { nil }
	spec_args_misses                       &SpecArgsMissCache         = unsafe { nil }
	generic_spec_decode_cache              &TypeLookupCache           = unsafe { nil }
	struct_field_type_cache                &FieldTypeCache            = unsafe { nil }
	variant_short_name_cache               &AliasCache                = unsafe { nil }
	selector_type_cache                    &SelectorTypeCache         = unsafe { nil }
	resolved_call_return_cache             &ResolvedCallReturnCache   = unsafe { nil }
	fn_return_name_cache                   &FnReturnNameCache         = unsafe { nil }
	variant_match_cache                    &VariantMatchCache         = unsafe { nil }
	alias_target_cache                     &AliasTargetCache          = unsafe { nil }
	noreturn_names                         &NoreturnNameList          = unsafe { nil }
	resolved_call_decl_cache               &ResolvedCallDeclCache     = unsafe { nil }
	call_qualified_name_cache              &CallQualifiedNameCache    = unsafe { nil }
	interface_type_cache                   &ContextLookupCache        = unsafe { nil }
	alias_equivalent_names_cache           &EquivalentNamesCache      = unsafe { nil }
	enum_expected_cache                    &EnumExpectedCache         = unsafe { nil }
	type_alias_name_cache                  &ContextBoolLookupCache    = unsafe { nil }
	raw_return_alias_cache                 &ContextBoolLookupCache    = unsafe { nil }
	interface_box_param_cache              &SourceTypeBoolCache       = unsafe { nil }
	alias_receiver_method_cache            &LookupCache               = unsafe { nil }
	receiver_method_cache                  &ReceiverMethodCache       = unsafe { nil }
	promote_text_cache                     &PromoteTextCache          = unsafe { nil }
	used_fn_name_cache                     &UsedFnNameCache           = unsafe { nil }
	call_variadic_cache                    &BoolLookupCache           = unsafe { nil }
	str_alias_cache                        &StrAliasCache             = unsafe { nil }
	qname_scratch                          &QualifiedNameScratch      = unsafe { nil }
	file_import_cache                      &util.KeyRecentCache       = unsafe { nil }
	file_import_name_filter                &FileImportNameFilter      = unsafe { nil }
	generic_type_name_index_cache          &GenericTypeNameIndexCache = &GenericTypeNameIndexCache{}
	generic_alias_names                    map[u32]bool
	generic_exact_alias_names              map[u32]bool
	generic_concrete_type_names            map[u32]bool
	generic_type_authority_names           map[u32]bool
	generic_transform_concrete_type_names  map[u32]bool
	generic_transform_concrete_index_count int
	generic_main_struct_names              map[u32]bool
	generic_enum_type_names                map[u32]bool
	generic_checker_struct_names           map[u32]bool
	generic_checker_struct_short_names     map[u32]bool
	generic_checker_struct_index_count     int
	generic_checker_sum_names              map[u32]bool
	generic_checker_sum_index_count        int
	generic_checker_interface_names        map[u32]bool
	generic_checker_interface_index_count  int
	fn_signature_keys                      map[u32]u32
	source_c_name_ids                      map[u32]u32
	source_sum_field_name_ids              map[u32]u32
	encoded_type_suffix_cache              &EncodedTypeSuffixCache = unsafe { nil }
	generic_parameter_type_names           map[u32]bool
	generic_parameter_type_index_count     int
	generic_enum_index_count               int
	generic_type_indexes_ready             bool
	generic_alias_index_concrete_count     int
	generic_alias_index_authority_count    int
	type_alias_suffixes                    map[u32]u32
	static_method_names                    map[string]bool
	static_method_names_ready              bool
	type_alias_short_index                 &TypeAliasShortIndex = unsafe { nil }
	local_decl_nodes_by_name               map[string][]int
	fn_decl_offsets_by_file                map[int][]int
	if_expr_nodes_by_file                  map[int][]int
	struct_field_decl_metas_cache          map[u32]map[string]FieldDeclMeta
	comptime_field_metas_cache             map[u32][]FieldMeta
	comptime_method_metas_cache            map[u64]map[string][]MethodMeta
	comptime_method_decls                  map[u32][]ComptimeMethodDecl
	comptime_raw_attribute_nodes           map[int]int
	comptime_method_index_nodes            int
	comptime_method_index_module           string
	comptime_method_index_file             string
	// Mutable schema metadata belongs to this worker and is absent until a
	// declaration actually uses `@[attribute]`. Forks start with a nil registry.
	comptime_attribute_schema_state &ComptimeAttributeSchemaState = unsafe { nil }
	comptime_method_line_offsets    map[string][]int
	comptime_reflected_for_roles    map[string]u8
	comptime_reflected_for_ready    bool
	call_param_types_recent         &CallParamTypesRecentCache = unsafe { nil }
	call_param_types_decl_cache     map[int][]types.Type
	packed_variadic_tail_types      map[int]u32
	call_param_types_decl_misses    map[string]bool
	call_param_types_decl_shared    bool
	call_param_types_decl_index     map[string]FnParamDeclRef
	call_param_types_index_ready    bool
	call_param_types_prepared       bool
	fixed_array_borrow_params       map[int][]bool
	call_provenance_borrow_params   map[int][]bool
	preserve_call_provenance        bool
	borrow_param_mentions           &BorrowParamMentions = unsafe { nil }
	used_fns                        map[string]bool
	used_fns_parent                 &map[string]bool = unsafe { nil }
	used_fns_root                   &map[string]bool = unsafe { nil }
	// used_fns_helper_snapshot is the immutable used set that workers forked from
	// this transformer read while it keeps recording names of its own.
	used_fns_helper_snapshot  &map[string]bool = unsafe { nil }
	comptime_reflected_params map[string][]ParamMeta
	// sum_eq_types records sum and recursive struct deep-equality helpers,
	// keyed by the concrete helper name with the
	// module/file context of the requesting call site (type resolution inside
	// the helper body needs that context). The helpers are synthesized
	// serially after the (possibly parallel) transform completes.
	sum_eq_types                  map[string]SumEqRequest
	sum_eq_synthesized            map[string]bool
	sum_eq_helper_module          string
	auto_str_types                map[u32]AutoStrRequest
	auto_str_synthesized          map[u32]bool
	auto_str_helper_module        string
	auto_str_synthesis_type       u32
	default_clone_types           map[u32]DefaultCloneRequest
	default_clone_synthesized     map[u32]bool
	default_clone_expansion_stack []u32
	interface_boxed_types         map[u64]bool
	interface_boxed_skip_nodes    []bool
	// interface_boxed_types_late records concrete boxes discovered after the
	// source-level box index is frozen. Each transform worker owns this map, so
	// auto-string lowering can extend its local dispatch index without mutating
	// the shared immutable source index.
	interface_boxed_types_late     map[u64]bool
	interface_boxed_impl_processed map[u64]bool
	interface_boxed_types_done     bool
	interface_boxed_types_frozen   bool
	interface_impl_indexes         map[u32]&types.InterfaceImplIndex
	interface_impl_spec_count      int
	ierror_none_type_id            int
	interface_var_concrete_types   flat.TypeTextBindings
	// alias_receiver_fns lists, by method name and in signature order, every signature
	// whose receiver is a type alias, whether or not its parameters are known yet. It
	// describes the checker tables while they hold alias_receiver_fns_signatures
	// signatures and alias_receiver_fns_aliases aliases; -1 marks it unusable.
	alias_receiver_fns            map[string][]string
	alias_receiver_fns_signatures int = -1
	alias_receiver_fns_aliases    int
	// alias_receiver_added_names logs, in registration order, the signatures that
	// merge_worker_signatures appended to the checker since alias_receiver_fns was listed.
	alias_receiver_added_names []string
	// static_method_added_names logs the return signatures merge_worker_signatures
	// appended to the checker since its static method names were listed.
	static_method_added_names []string
	// var_type_undo_log holds the bindings that set_var_type_binding replaced while
	// var_type_undo_active is set. A walk that only adds or rebinds locals restores a
	// lexical scope from it instead of copying every live binding on scope entry.
	var_type_undo_log    []VarTypeUndo
	var_type_undo_active bool
	// late_scan_gate is set while the filtered late-name scan walks function bodies.
	late_scan_gate &LateScanGate = unsafe { nil }
	// no_checked_numeric_infix turns checked_numeric_infix_can_skip_handlers off.
	no_checked_numeric_infix bool
	// append_elem_interface_cache answers array_append_elem_is_interface again.
	append_elem_interface_cache &ElemInterfaceCache = unsafe { nil }
	// generic_decl_name_tails holds the text after the last `.` of every key of
	// generic_fn_decls_cache, in both `@` spellings, and generic_static_method_names
	// the methods of its static type method keys. generic_decl_name_tails_count is the
	// size of the table they describe, or -1 while they describe none.
	generic_decl_name_tails       map[string]bool
	generic_static_method_names   map[string]bool
	generic_decl_name_tails_count int = -1
	// used_struct_operator_fns holds the callee names of direct calls seen during
	// monomorphize. Infix operators on generic instances are lowered to direct calls
	// (`Vec[int].+(a, b)`) before this pass, so an operator overload is specialized for
	// an instantiated generic struct only when its mangled name appears here — an instance
	// whose type argument never has the operator applied is not emitted with a body that
	// would fail C compilation.
	used_struct_operator_fns map[string]bool
	// active_generic_params holds the generic parameter names of the decl currently
	// being specialized/rewritten, in the same order as the inferred type `args`.
	// It lets type-text substitution map placeholders by name (so non-canonical
	// params like `D`/`F` resolve to the right arg) instead of by the positional
	// `generic_param_index` heuristic (which collapses anything outside the T/U/C
	// sequences to index 0). Empty for struct-generic specialization, which keeps
	// the legacy positional behaviour.
	active_generic_params []string
	// cloning_comptime_for_depth > 0 while a generic clone descends into a `$for` body: nested
	// generic calls there must not be specialized (the loop var members are not resolved yet).
	cloning_comptime_for_depth int
	cloning_comptime_for_vars  []string
	// declaring_comptime_field_locals is set while the body of a `$for` over the
	// fields is cloned for one field. The clone then declares the locals of the
	// body as it goes (see declare_comptime_field_local).
	declaring_comptime_field_locals bool
	// ignored_comptime_for_nodes marks source `$for` subtrees replaced by concrete
	// unrolled nodes. Keeping the marker outside the shared flat AST lets parallel
	// workers record their own discarded nodes without racing.
	ignored_comptime_for_nodes  []bool
	ignored_comptime_for_log    []int
	ignored_comptime_log_active bool
	// cloning_generic_fn_depth > 0 while a generic specialization is cloned with a live,
	// seeded parameter scope. Ident inference should use that scope rather than scan annotations.
	cloning_generic_fn_depth  int
	specialization_node_start int = -1
	// escaping_amp_ptrs holds the names of pointer locals `p` declared as `p := &v`
	// (v a value local) whose pointer escapes the function (is returned or retained
	// in nonlocal storage). V semantics auto-heap such a `v`; v3 otherwise takes the
	// address of a stack local that dies on return. Recomputed per function (structural
	// pre-pass in transform_fn_body), consumed when the `p := &v` decl is transformed
	// (RHS rewritten to a heap copy).
	escaping_amp_ptrs map[string]bool
	// escaping_amp_sources holds the source locals `v` of such `p := &v` escapes. A returned
	// pointer local can collect more than one source through later assignments (`p = &w`);
	// each possible source whose address may leave the frame is moved to the heap at its
	// declaration so mutations before the return remain visible to the caller.
	escaping_amp_sources map[string]bool
	// escape_decl_depths maps a local to the block depth of its declaration during the escape
	// scan, and escape_scope_depth is the depth of the statement being scanned. A block's
	// local is gone when the block ends, and a loop reuses it in the next iteration.
	escape_decl_depths map[string]int
	escape_scope_depth int
	// escaping_fixed_array_view_sources holds local storage exposed through a reference
	// parameter that can retain an inline fixed array as a dynamic view. Promote the root
	// before any aliases form, including when a containing struct is forwarded by reference.
	escaping_fixed_array_view_sources map[string]bool
	// Cache complete walks of nominal inline storage. Sum variants can contain fixed
	// arrays too; repeated reference arguments must not walk the same variants again.
	escape_fixed_array_nominal_cache map[u32]bool
	// skip_owned_base_nodes_without_regions: see PreparedSelfhostTransform.keeps_scope_without_regions.
	skip_owned_base_nodes_without_regions bool
	// heaped_amp_locals records which of those sources were actually moved to the heap, so
	// the `p := &v` alias emits `p = v` (the heap pointer) instead of a fresh memdup copy.
	heaped_amp_locals map[string]bool
	// escaping_interface_box_locals holds interface locals boxed from stack-backed pointer
	// sources and later returned. The box can alias the stack value while in scope, but its
	// `_object` needs a heap copy before the interface value leaves the frame.
	escaping_interface_box_locals map[string]bool
	// local_closure_cleanup_decls maps source declaration node ids to runtime
	// closure locals that do not escape their lexical scope.
	local_closure_cleanup_decls map[int]string
	// local_closure_cleanup_values maps individual RHS expression node ids in
	// multi-variable declarations to their non-escaping closure bindings.
	local_closure_cleanup_values map[int]string
	// local_closure_cleanup_assigns maps source assignment node ids to the exact
	// scope-owned closure binding they overwrite. Identifier spelling alone is
	// insufficient because disjoint lexical scopes may reuse the same name.
	local_closure_cleanup_assigns map[int]string
	// local_closure_field_cleanups contains assignments and aggregate initializer values that
	// create a fresh closure in a non-escaping lexical local. Their generated temporary owns the
	// allocation until that lexical scope exits.
	local_closure_field_cleanups map[int]bool
	// exclusive_closure_return_fns contains source functions proven to return a newly
	// allocated closure without storing, passing, or otherwise aliasing that closure.
	// Discarded call results may be reclaimed only for functions in this frozen pre-pass map.
	exclusive_closure_return_fns   map[string]bool
	exclusive_closure_returns_done bool
	// closure_scan_beside_borrow_prescan lets the master run the closure-return
	// scan while the borrow-summary prescan helpers work (self-host preparation).
	closure_scan_beside_borrow_prescan bool
	// mut_fixed_array_capture_sources records locals captured as `mut` fixed arrays by
	// closures that are not proven local. Their storage is moved to the heap so the outer
	// binding and escaped closure context keep sharing the same durable array.
	mut_fixed_array_capture_sources    map[string]bool
	active_specialization_args         flat.TypeTextList
	active_specialization_main_types   map[u32]bool
	specialization_main_type_closures  map[u64][]&SpecializationMainTypeClosure
	generic_specialization_args        SpecializationArgsBindings
	generic_specialization_args_log    []SpecializationArgsKey
	generic_specialization_args_parent &SpecializationArgsBindings = unsafe { nil }
	generic_fn_specs_in_progress       GenericFnSpecBoolMap
	library_bodies                     LibraryBodies // which library instances a check clones without their bodies
	generic_fn_spec_nodes              GenericFnSpecNodeMap
	monomorph_cache_specs              GenericFnSpecCacheSpecMap
	monomorph_signature_types          []MonomorphSignatureType
	monomorph_signature_spec_keys      GenericFnSpecBoolMap
	generic_clone_children             []flat.NodeId
	node_context_stack                 []flat.NodeId
	specialization_decl_nodes_by_name  map[string][]int
	defer_nested_generic_emissions     bool
	parallel_monomorphize              bool
	parallel_monomorph_worker          bool
	generic_signatures_pre_registered  bool
	pending_generic_fn_specs           []PendingGenericFnSpec
	pending_generic_fn_spec_keys       GenericFnSpecBoolMap
	generic_fn_decls_cache             map[string]GenericFnDecl
	generic_receiver_methods_by_name   map[string][]string
	generic_fn_call_names              map[string]bool
	generic_fn_decls_ready             bool
	generic_struct_specs_cache         map[u32]u32
	generic_sum_specs_cache            map[u32]GenericSpecContext
	generic_materialization_scan_from  int
	generic_materialization_ready      bool
	parallel_monomorph_scan_nodes      []int
	parallel_monomorph_scan_start      int
	parallel_monomorph_scan_end        int
	fn_scan_costs                      []i32
	fn_escape_scan_flags               []u8
	literal_fn_decls                   []int
	literal_fn_decls_ready             bool
	parallel_monomorph_struct_specs    map[u32]u32
	parallel_monomorph_sum_specs       map[u32]GenericSpecContext
	generic_call_spec_cache            map[int]GenericCallSpec
	generic_call_spec_settled          &SettledGenericCalls = unsafe { nil }
	generic_call_spec_misses           map[int]bool
	stringify_stack                    []u32
	stringify_depth_cap                int = max_stringify_nesting_depth
	struct_autostr_recurse_types       map[u32]bool
	str_expansion_memo                 map[u64]int
	deferred_expansion_items           []FnWorkItem
	deferred_expansion_count           int
	// node_module_map_cache/node_file_map_cache hold one interned id per node
	// (0 == unset) into node_context_texts. A whole-AST table of 24-byte string
	// headers costs hundreds of MiB on a compiler-sized program; the id table is
	// 4 bytes per node and resolves to the same canonical spelling.
	node_module_map_cache  []u16
	node_file_map_cache    []u16
	node_context_texts     []string
	node_context_text_ids  map[string]u16
	node_module_map_nodes  int = -1
	node_context_read_only bool
	// node_context_lazy_end: the nodes below it take their context on demand
	// (see node_context_owner).
	node_context_lazy_end int
	// The declaration nodes lowering appended behind the checker's top-level
	// index, kept for the transformer of a monomorphization stage (see
	// appended_declaration_scan).
	appended_decls_kept  bool
	appended_decls_from  int
	appended_decls_until int
	appended_decls       []int
	// used_fns_log records names newly inserted into used_fns while the
	// late-used-fn-bodies pass runs, so that pass can tell "was this name
	// already used before the current body's transform" without cloning the
	// whole used_fns map per function (those clones dominated the pass's time
	// and, under -gc none, were never freed).
	used_fns_log        []string
	used_fns_log_active bool
	// transformed_fns[i] is set when the fn_decl at node id i has had its body
	// transformed (main pass, any thread — worker chunks are marked at merge).
	// The late-used-fn-bodies pass excludes these candidates: lowered bodies
	// surface sanitized call spellings (`seed__time_seed_array`) that the
	// used-set (holding `seed.time_seed_array`) cannot filter, which used to
	// re-transform hundreds of already-transformed bodies every build.
	transformed_fns []bool
	// lowered_fn_bodies[i] is set, while a tree that went through the transform
	// stage is monomorphized, when the body of the fn_decl at node id i has no
	// lowering left: the used set named the function when monomorphization
	// started, so the transform stage settled its body, or an earlier round of the
	// late-used-fn-bodies pass lowered it. That pass takes the first insertion of
	// a used-set spelling for a function that just became reachable, while a
	// function goes by several spellings and markused records only some of them
	// (`Tag.add_frame`, not `Tag__add_frame`): a call from a specialization got an
	// already lowered body lowered again. It is not transformed_fns, which
	// lower_remaining_matches_in_used_fns skips: that walk still has matches to
	// lower in the bodies of the transform stage.
	lowered_fn_bodies []bool
	// match_lowered_fns[i] is set once lower_remaining_matches_in_used_fns has
	// walked the body of the fn_decl at node id i; a later call skips it.
	match_lowered_fns []bool
	// mono_pass_state lets the next monomorphize_pass continue the last one.
	mono_pass_state MonomorphPassState
	// generic_index_operators_known caches has_generic_index_operators: 0 not yet
	// tested, 1 yes, -1 no.
	generic_index_operators_known int
	// generic_arithmetic_operators_known caches has_generic_arithmetic_operators,
	// with the same values.
	generic_arithmetic_operators_known int
	// box_type_text_cache is set while a box scan runs.
	box_type_text_cache &BoxTypeTextCache = unsafe { nil }
	// match_holders is the last match_holding_fns result, for the nodes below
	// match_holders_scanned.
	match_holders         []bool
	match_holders_scanned int
	// ignored_state lets the next monomorphize_ignored_nodes update the last one.
	ignored_state IgnoredNodesState
	// direct_monomorph_specs counts the specializations the master emitted itself.
	direct_monomorph_specs int
	// Shared-base (clone-free) parallel transform: all threads operate on views
	// of the master arrays, appending into pre-partitioned capacity regions.
	// While base_write_intercept is set, in-place writes to base-range node
	// slots outside the current item's subtree range [item_range_lo,
	// item_range_hi] are dropped (workers — matching the old clone path, where
	// such writes stayed in the discarded clone) or deferred until after join
	// (master, defer_oor_writes — matching the old path where the master's
	// writes landed on the shared AST).
	base_write_intercept      bool
	defer_oor_writes          bool
	shared_base_nodes         int = -1
	shared_base_children      int = -1
	item_range_lo             int = -1
	item_range_hi             int = -1
	item_escape_scan_known    bool
	item_escape_scan_needed   bool
	memo_node_types           bool
	memo_expansion_node_types bool
	node_type_memo            &NodeTypeMemo = unsafe { nil }
	expansion_node_type_memo  &NodeTypeMemo = unsafe { nil }
	deferred_base_writes      []DeferredBaseWrite
	// Prealloc self-host builds put helper-thread scratch allocations in
	// disposable arenas. The worker's surviving AST strings are cloned by the
	// master before that arena is released.
	scope_parallel_workers   bool
	parallel_enabled         bool
	fast_escape_precheck     bool
	ordinary_escape_precheck bool
	// The skip-generics body pass owns disjoint source-node ranges. Reusing a
	// source parent when its transformed child count is unchanged avoids
	// copying that parent and its child span into the append-only AST.
	inplace_child_rewrites       bool
	inplace_fn_child_rewrites    bool
	inplace_assign_rewrites      bool
	inplace_simple_rewrites      bool
	inplace_lvalue_rewrites      bool
	inplace_block_expr_rewrites  bool
	inplace_decl_assign_rewrites bool
	inplace_scalar_prefixes      bool
	lean_struct_init_fields      bool
	inplace_struct_fields        bool
	memo_call_param_type_names   bool
	memo_semantic_type_names     bool
	prefix_param_scan            bool
	// Child-only lowering preserves the parent expression's checked semantic
	// type. Keep that dense sidecar entry so later transform/cgen queries do not
	// reconstruct the same type from the lowered text tree.
	preserve_inplace_expr_types bool
	inplace_child_log           []InplaceChildRewrite
	// Shared type-match bodies cannot use one variant's recorded callee for substitution.
	array_dsl_multitype_depth int
	// inplace_rewrite_holds suspends the in-place child rewrites while the
	// source subtree being transformed is still needed afterwards: a multi-type
	// match arm transforms its body once per variant, and an array append reads
	// its source operand again after lowering it. An in-place rewrite would hand
	// those later reads the lowered nodes instead of the source ones.
	inplace_rewrite_holds int
	worker_scope          voidptr
	// Helper merge tables are disposable; published AST text uses their parent arena.
	merge_scratch_scope voidptr
	// merge_scratch_shared marks a helper whose merge_scratch_scope belongs to the
	// thread that ran it, and holds the bookkeeping of that thread's other helpers.
	merge_scratch_shared bool
	// Arenas of the prepare-time index helpers; the driver frees them with the
	// preparation arena after canonicalizing the node texts they back. Only the
	// self-host prepared path collects them, so the helper threads scope their
	// indexes only when this is set.
	retain_prescan_scopes   bool
	prescan_scopes          []voidptr
	scoped_base_nodes       int = -1
	scoped_owned_base_nodes map[int]bool
	scoped_owned_base_log   []flat.NodeId
	// A helper that transforms a private copy of the base AST logs the base nodes
	// it rewrites in place, so merge_worker can publish them. 0 disables the log.
	clone_base_nodes        int
	clone_base_write_log    []flat.NodeId
	scoped_base_log_active  bool
	scoped_promoted_texts   map[string]string
	retain_worker_results   bool
	retained_worker_regions []ScopedTransformRegion
	stage_scope             voidptr
	scoped_monomorphize     bool
	monomorph_worker_scopes []voidptr
	signature_maps_shared   bool
	signature_maps_changed  bool
	// signature_keys_borrowed marks a fork whose shared signature tables belong
	// to a transformer that outlives it: detaching them can borrow their keys.
	signature_keys_borrowed bool
	// Allocations lowering adds that the source does not show, for
	// -warn-about-allocs; see warn_alloc.
	alloc_warnings []AllocWarning
	// `$if`s in `$for` bodies whose conditions cannot be decided; see
	// reject_unevaluated_comptime_if.
	unevaluated_comptime_ifs []UnevaluatedComptimeIf
	// The statements that write the options passed to a method's `mut a ?T` parameters
	// back after the call (transform_call_expr).
	mut_optional_call_writebacks []flat.NodeId
	// Keep native live metadata last so ordinary transform fields retain their offsets.
	live_metadata       &LiveMetadata = unsafe { nil }
	live_reload_runtime bool
}

Transformer represents transformer data used by transform.

fn (Transformer) synthesize_sum_eq_helpers #

fn (mut t Transformer) synthesize_sum_eq_helpers() []string

synthesize_sum_eq_helpers generates requested sum and recursive struct equality helpers. Building one helper body can request more nested aggregate helpers, so this drains a worklist. Runs serially on the merged AST (workers only record names). Returns the names newly marked used while building the helper bodies (e.g. a payload struct's overloaded ==), so the caller can run them through the late-used-fn pass — synthesis happens after that pass, so such functions would otherwise miss body transformation.

fn (Transformer) make_call #

fn (mut t Transformer) make_call(fn_name string, args []flat.NodeId) flat.NodeId

make_call builds make call data for transform.

fn (Transformer) make_call_typed #

fn (mut t Transformer) make_call_typed(fn_name string, args []flat.NodeId, typ_id u32) flat.NodeId

make_call_typed builds make call typed data for transform.

fn (Transformer) make_call_expr_typed #

fn (mut t Transformer) make_call_expr_typed(fn_expr flat.NodeId, args []flat.NodeId, typ_id u32) flat.NodeId

make_call_expr_typed builds make call expr typed data for transform.

fn (Transformer) make_empty #

fn (mut t Transformer) make_empty() flat.NodeId

make_empty builds make empty data for transform.

fn (Transformer) make_method_call #

fn (mut t Transformer) make_method_call(receiver flat.NodeId, method_name string, args []flat.NodeId) flat.NodeId

make_method_call builds make method call data for transform.

fn (Transformer) make_selector #

fn (mut t Transformer) make_selector(base flat.NodeId, field string, typ_id u32) flat.NodeId

make_selector builds make selector data for transform.

fn (Transformer) make_selector_op #

fn (mut t Transformer) make_selector_op(base flat.NodeId, field string, typ_id u32, op flat.Op) flat.NodeId

make_selector_op builds make selector op data for transform.

fn (Transformer) make_sum_tag_selector #

fn (mut t Transformer) make_sum_tag_selector(base flat.NodeId, op flat.Op) flat.NodeId

make_sum_tag_selector builds an internal selector for a sumtype discriminator.

fn (Transformer) make_index #

fn (mut t Transformer) make_index(base flat.NodeId, index flat.NodeId, typ_id u32) flat.NodeId

make_index builds make index data for transform.

fn (Transformer) make_cast #

fn (mut t Transformer) make_cast(target_type_id u32, expr flat.NodeId, typ_id u32) flat.NodeId

make_cast builds make cast data for transform.

fn (Transformer) make_postfix #

fn (mut t Transformer) make_postfix(expr flat.NodeId, op flat.Op) flat.NodeId

make_postfix builds make postfix data for transform.

fn (Transformer) make_struct_init #

fn (mut t Transformer) make_struct_init(name_id u32) flat.NodeId

make_struct_init builds make struct init data for transform.

fn (Transformer) make_array_init #

fn (mut t Transformer) make_array_init(elem_type_id u32) flat.NodeId

make_array_init builds make array init data for transform.

fn (Transformer) make_map_init #

fn (mut t Transformer) make_map_init(map_type_id u32) flat.NodeId

make_map_init builds make map init data for transform.

fn (Transformer) make_string_literal #

fn (mut t Transformer) make_string_literal(value string) flat.NodeId

make_string_literal creates literal text without interpreting interpolation syntax.

fn (Transformer) make_int_literal #

fn (mut t Transformer) make_int_literal(value int) flat.NodeId

make_int_literal builds make int literal data for transform.

fn (Transformer) make_int_literal_typed #

fn (mut t Transformer) make_int_literal_typed(value string, typ_id u32) flat.NodeId

make_int_literal_typed creates an integer literal node with the given source type ID.

fn (Transformer) make_float_literal #

fn (mut t Transformer) make_float_literal(value string) flat.NodeId

make_float_literal builds make float literal data for transform.

fn (Transformer) make_float_literal_typed #

fn (mut t Transformer) make_float_literal_typed(value string, typ_id u32) flat.NodeId

make_float_literal_typed creates a floating-point literal node with the given source type ID.

fn (Transformer) make_bool_literal #

fn (mut t Transformer) make_bool_literal(value bool) flat.NodeId

make_bool_literal builds make bool literal data for transform.

fn (Transformer) make_sizeof_type #

fn (mut t Transformer) make_sizeof_type(type_name_id u32) flat.NodeId

make_sizeof_type builds make sizeof type data for transform.

fn (Transformer) transform_stmts #

@[direct_array_access]
fn (mut t Transformer) transform_stmts(ids []flat.NodeId) []flat.NodeId

transform_stmts transforms transform stmts data for transform.

fn (Transformer) transform_stmt #

@[direct_array_access]
fn (mut t Transformer) transform_stmt(id flat.NodeId) []flat.NodeId

transform_stmt transforms transform stmt data for transform.

fn (Transformer) transform_expr #

@[direct_array_access]
fn (mut t Transformer) transform_expr(id flat.NodeId) flat.NodeId

transform_expr transforms transform expr data for transform.

fn (Transformer) transform_lvalue #

fn (mut t Transformer) transform_lvalue(id flat.NodeId) flat.NodeId

transform_lvalue transforms transform lvalue data for transform.

fn (Transformer) new_temp #

fn (mut t Transformer) new_temp(prefix string) string

new_temp supports new temp handling for Transformer.

fn (Transformer) make_ident #

fn (mut t Transformer) make_ident(name string) flat.NodeId

make_ident builds make ident data for transform.

fn (Transformer) make_decl_assign #

fn (mut t Transformer) make_decl_assign(name string, rhs flat.NodeId) flat.NodeId

make_decl_assign builds make decl assign data for transform.

fn (Transformer) make_expr_stmt #

fn (mut t Transformer) make_expr_stmt(expr flat.NodeId) flat.NodeId

make_expr_stmt builds make expr stmt data for transform.

fn (Transformer) make_assign #

fn (mut t Transformer) make_assign(lhs flat.NodeId, rhs flat.NodeId) flat.NodeId

make_assign builds make assign data for transform.

fn (Transformer) make_assign_op #

fn (mut t Transformer) make_assign_op(lhs flat.NodeId, rhs flat.NodeId, op flat.Op) flat.NodeId

make_assign_op builds make assign op data for transform.

fn (Transformer) make_block #

fn (mut t Transformer) make_block(stmts []flat.NodeId) flat.NodeId

make_block builds make block data for transform.

fn (Transformer) make_infix #

fn (mut t Transformer) make_infix(op flat.Op, lhs flat.NodeId, rhs flat.NodeId) flat.NodeId

make_infix builds make infix data for transform.

fn (Transformer) make_prefix #

fn (mut t Transformer) make_prefix(op flat.Op, expr flat.NodeId) flat.NodeId

make_prefix builds make prefix data for transform.

fn (Transformer) make_paren #

fn (mut t Transformer) make_paren(expr flat.NodeId) flat.NodeId

make_paren builds make paren data for transform.

fn (Transformer) make_if #

fn (mut t Transformer) make_if(cond flat.NodeId, then_block flat.NodeId, else_block flat.NodeId) flat.NodeId

make_if builds make if data for transform.

fn (Transformer) make_if_with_skip_ownership_drops #

fn (mut t Transformer) make_if_with_skip_ownership_drops(cond flat.NodeId, then_block flat.NodeId, else_block flat.NodeId) flat.NodeId

make_if_with_skip_ownership_drops builds a synthetic if that must not consume ownership-drop metadata recorded for source control-flow nodes.

fn (Transformer) push_smartcast #

fn (mut t Transformer) push_smartcast(expr_name string, variant_id u32, sum_type_id u32)

push_smartcast records the variant and subject source type IDs for an expression.

fn (Transformer) pop_smartcast #

fn (mut t Transformer) pop_smartcast()

pop_smartcast updates pop smartcast state for Transformer.

fn (Transformer) find_smartcast #

@[direct_array_access]
fn (t &Transformer) find_smartcast(expr_name string) ?SmartcastContext

find_smartcast resolves find smartcast information for transform.

fn (Transformer) drain_pending #

fn (mut t Transformer) drain_pending(mut result []flat.NodeId)

drain_pending supports drain pending handling for Transformer.

fn (Transformer) is_sum_variant #

fn (t &Transformer) is_sum_variant(name_id u32) bool

is_sum_variant reports whether is sum variant applies in transform.

fn (Transformer) get_struct_info #

fn (t &Transformer) get_struct_info(name string) ?StructInfo

get_struct_info returns get struct info data for Transformer.

fn (Transformer) get_global_type #

fn (t &Transformer) get_global_type(name string) ?u32

get_global_type returns get global type data for Transformer.

fn (Transformer) auto_str_synthesis_type_text #

@[inline]
fn (value &Transformer) auto_str_synthesis_type_text() string

auto_str_synthesis_type_text resolves the indexed source type spelling.

fn (Transformer) cur_fn_receiver_name_text #

@[inline]
fn (value &Transformer) cur_fn_receiver_name_text() string

cur_fn_receiver_name_text resolves the indexed source type spelling.

fn (Transformer) active_specialization_args_text #

@[inline]
fn (value &Transformer) active_specialization_args_text() []string

active_specialization_args_text resolves the indexed source type spelling.