refactor(stdlib/S1.2): delete module_fns; dissolve legacy_direct_any [additive]
Delete module_fns as a separate function-author fact source. Its authors already live in the module_decls raw facts, so lowerRetainedSameNameAuthors now reads function authors straight out of module_decls (filtered to *FnDecl via fnDeclOfRaw) — the same path → name → RawDeclRef store, fn-filtered. Remove imports.ModuleFns / FnIndex / indexModuleFns / buildModuleFns / fnDeclOf, the Compilation.module_fns field + its build + wiring, and ProgramIndex.module_fns. Remove VisibilityMode.legacy_direct_any (the quarantined own-scope-plus-full- import_graph mode): no production caller passed it, so the collectVisibleAuthors and isVisible switch arms that handled it are dead and go too, collapsing VisEdgeSet to the single flat-import walk. No semantic fallback is introduced; import_graph stays the transitive-visibility source for findVisibleImpls. Additive: the old maps stay active and lowering still consumes them — no lowering consumer is cut over to the DeclTable (that is S3), and no resolution behavior changes. Tests that drove the removed symbols are rerouted through module_decls / the flat-edge walk. Gate over the baseline-green corpus: zig build, zig build test (424/424), bash tests/run_examples.sh (540 passed) — all exit 0; single-author output byte-identical; multi-author 0722–0740 stdout/exit unchanged.
This commit is contained in:
10
src/core.zig
10
src/core.zig
@@ -29,9 +29,6 @@ pub const Compilation = struct {
|
||||
/// Flat-only subset of `import_graph` (bare `#import` edges, no namespaced
|
||||
/// `ns :: #import`). Borrowed by `ProgramIndex.flat_import_graph`.
|
||||
flat_import_graph: std.StringHashMap(std.StringHashMap(void)),
|
||||
/// Per-module authored-function index (`path → name → *const FnDecl`).
|
||||
/// Borrowed by `ProgramIndex.module_fns`.
|
||||
module_fns: imports.ModuleFns,
|
||||
/// Per-module scalar raw-decl index (`path → name → RawDeclRef`), built by
|
||||
/// `imports.buildImportFacts`. Borrowed by `ProgramIndex.module_decls`.
|
||||
module_decls: imports.ModuleDecls,
|
||||
@@ -69,7 +66,6 @@ pub const Compilation = struct {
|
||||
.module_scopes = std.StringHashMap(std.StringHashMap(void)).init(allocator),
|
||||
.import_graph = std.StringHashMap(std.StringHashMap(void)).init(allocator),
|
||||
.flat_import_graph = std.StringHashMap(std.StringHashMap(void)).init(allocator),
|
||||
.module_fns = imports.ModuleFns.init(allocator),
|
||||
.module_decls = imports.ModuleDecls.init(allocator),
|
||||
.namespace_edges = imports.NamespaceEdges.init(allocator),
|
||||
.decl_table = imports.DeclTable.init(allocator),
|
||||
@@ -133,11 +129,6 @@ pub const Compilation = struct {
|
||||
self.module_scopes.put(entry.key_ptr.*, entry.value_ptr.scope) catch {};
|
||||
}
|
||||
|
||||
// Per-module authored-function index, built from the SAME modules as
|
||||
// `module_scopes` (main + every cache entry). Keyed by path; same-name
|
||||
// cross-module authors stay distinct under their own paths.
|
||||
imports.buildModuleFns(self.allocator, self.file_path, mod, &cache, &self.module_fns) catch {};
|
||||
|
||||
// Raw import facts (the unified-resolver store): scalar per-module
|
||||
// raw-decl index + namespace edges, built from the SAME modules. Nothing
|
||||
// consumes these yet — they are borrowed by `ProgramIndex` for later
|
||||
@@ -320,7 +311,6 @@ pub const Compilation = struct {
|
||||
lowering.program_index.module_scopes = &self.module_scopes;
|
||||
lowering.program_index.import_graph = &self.import_graph;
|
||||
lowering.program_index.flat_import_graph = &self.flat_import_graph;
|
||||
lowering.program_index.module_fns = &self.module_fns;
|
||||
lowering.program_index.module_decls = &self.module_decls;
|
||||
lowering.program_index.namespace_edges = &self.namespace_edges;
|
||||
lowering.program_index.decl_table = &self.decl_table;
|
||||
|
||||
Reference in New Issue
Block a user