Skip to content

v2.markused

fn decl_key #

fn decl_key(module_name string, decl ast.FnDecl, env &types.Environment) string

decl_key computes the stable key used by mark_used for a function declaration.

fn decl_key_from_cursor #

fn decl_key_from_cursor(module_name string, c ast.Cursor, env &types.Environment) string

decl_key_from_cursor computes the stable markused key for a flat FnDecl cursor.

fn is_builtin_array_file #

fn is_builtin_array_file(path string) bool

fn is_builtin_map_file #

fn is_builtin_map_file(path string) bool

fn is_builtin_runtime_keep_file #

fn is_builtin_runtime_keep_file(path string) bool

fn is_builtin_string_file #

fn is_builtin_string_file(path string) bool

fn mark_used #

fn mark_used(files []ast.File, env &types.Environment) map[string]bool

mark_used walks reachable function/method bodies and returns declaration keys for the functions that are used at least once.

fn mark_used_flat #

fn mark_used_flat(flat &ast.FlatAst, env &types.Environment) map[string]bool

mark_used_flat is the flat-input entry point for the markused pass. It accepts a FlatAst — the canonical post-parse representation — instead of a rehydrated []ast.File.

The collect_defs phase reads each file's imports and top-level stmts via FlatAst.read_file_imports / FileCursor.stmts, so the per-file File struct (with its attribute/import/stmt slices and selector_names map) is never materialized. Function bodies are still decoded as legacy ast.Stmt and stored in FnInfo for walk_collected — that phase is the next slice to port. The differential harness in markused_diff_test.v guards bit-for-bit equality with the legacy walker at every step.

fn mark_used_flat_with_options #

fn mark_used_flat_with_options(flat &ast.FlatAst, env &types.Environment, opts MarkUsedOptions) map[string]bool

fn mark_used_with_options #

fn mark_used_with_options(files []ast.File, env &types.Environment, opts MarkUsedOptions) map[string]bool

fn should_always_emit_for_markused #

fn should_always_emit_for_markused(path string) bool

fn should_keep_builtin_array_decl #

fn should_keep_builtin_array_decl(decl ast.FnDecl) bool

fn should_keep_builtin_map_decl #

fn should_keep_builtin_map_decl(decl ast.FnDecl) bool

fn should_keep_builtin_string_decl #

fn should_keep_builtin_string_decl(decl ast.FnDecl) bool

struct MarkUsedOptions #

struct MarkUsedOptions {
pub:
	minimal_runtime_roots bool
}