aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-24 19:21:18 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 17:51:21 -0700
commit4d28db7329c32d7a2b7915d7a5da7f93c4088ccd (patch)
treede9341b8223f07d7329d337b622ee2cab2a05c6f /src
parentedccd68adf58273f44c57ef0d609ec09cc3fb41e (diff)
downloadzig-4d28db7329c32d7a2b7915d7a5da7f93c4088ccd.tar.gz
zig-4d28db7329c32d7a2b7915d7a5da7f93c4088ccd.zip
Zcu: mark outdated decl handling as unreachable from only_c builds
This way we don't drag in linker code into only_c builds that doesn't need to be there.
Diffstat (limited to 'src')
-rw-r--r--src/Module.zig20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 86c124e3b5..bf278fb9b5 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -3167,6 +3167,7 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void {
.complete => return,
.outdated => blk: {
+ if (build_options.only_c) unreachable;
// The exports this Decl performs will be re-discovered, so we remove them here
// prior to re-analysis.
try mod.deleteDeclExports(decl_index);
@@ -4678,25 +4679,6 @@ pub fn analyzeFnBody(mod: *Module, func_index: InternPool.Index, arena: Allocato
};
}
-fn markOutdatedDecl(mod: *Module, decl_index: Decl.Index) !void {
- const decl = mod.declPtr(decl_index);
- try mod.comp.work_queue.writeItem(.{ .analyze_decl = decl_index });
- if (mod.failed_decls.fetchSwapRemove(decl_index)) |kv| {
- kv.value.destroy(mod.gpa);
- }
- if (mod.cimport_errors.fetchSwapRemove(decl_index)) |kv| {
- var errors = kv.value;
- errors.deinit(mod.gpa);
- }
- if (mod.emit_h) |emit_h| {
- if (emit_h.failed_decls.fetchSwapRemove(decl_index)) |kv| {
- kv.value.destroy(mod.gpa);
- }
- }
- _ = mod.compile_log_decls.swapRemove(decl_index);
- decl.analysis = .outdated;
-}
-
pub fn createNamespace(mod: *Module, initialization: Namespace) !Namespace.Index {
return mod.intern_pool.createNamespace(mod.gpa, initialization);
}