Skip to content

v3.markused #

Parallel body-call precollection. Each worker analyzes a disjoint, contiguous range of fn_decl bodies with its own forked TypeChecker (private type_cache, so checker memoization never races) and writes into disjoint slots of a preallocated results array. The result content per body is a pure function of the (read-only) AST and checker tables, so the outcome is identical to the serial fallback.

fn is_trivial_literal_output_program #

fn is_trivial_literal_output_program(a &flat.FlatAst, diagnostic_files map[string]bool) bool

is_trivial_literal_output_program reports whether the selected source consists only of literal print calls. It does not depend on semantic collection, so the driver can select its non-generic check path before checking function bodies.

fn mark_used #

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

mark_used updates mark used state for markused.

fn mark_used_for_cache #

fn mark_used_for_cache(a &flat.FlatAst, tc &types.TypeChecker, test_files []string, source_modules map[string]bool) map[string]bool

mark_used_for_cache roots every concrete function in modules being built for the object cache.

fn mark_used_for_cache_with_generic_usage #

fn mark_used_for_cache_with_generic_usage(a &flat.FlatAst, tc &types.TypeChecker, test_files []string, source_modules map[string]bool) (map[string]bool, bool)

mark_used_for_cache_with_generic_usage roots cached module functions and reports whether their reachable code requires monomorphization.

fn mark_used_for_cache_without_generic_detection #

fn mark_used_for_cache_without_generic_detection(a &flat.FlatAst, tc &types.TypeChecker, test_files []string, source_modules map[string]bool) map[string]bool

mark_used_for_cache_without_generic_detection is the self-host cache variant for inputs whose caller already guarantees that monomorphization is unnecessary.

fn mark_used_for_tests #

fn mark_used_for_tests(a &flat.FlatAst, tc &types.TypeChecker, test_files []string) map[string]bool

fn mark_used_for_tests_with_generic_usage #

fn mark_used_for_tests_with_generic_usage(a &flat.FlatAst, tc &types.TypeChecker, test_files []string) (map[string]bool, bool)

mark_used_for_tests_with_generic_usage is the test-file-rooted variant of mark_used_with_generic_usage.

fn mark_used_with_generic_usage #

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

mark_used_with_generic_usage also reports whether reachable code uses a generic function, struct, or sum type and therefore requires monomorphization.

fn mark_used_without_generic_detection #

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

mark_used_without_generic_detection is the self-host variant for inputs whose caller already guarantees that monomorphization is unnecessary.

fn reachable_const_exprs #

fn reachable_const_exprs(a &flat.FlatAst, tc &types.TypeChecker, root_ids []flat.NodeId, root_modules []string, root_files []string) []flat.NodeId

reachable_const_exprs returns const initializer expressions referenced by the supplied post-transform AST roots, including transitive const-to-const references.