authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-11-03 12:08:33-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-11-03 21:24:13-04:00
log1ccc68f307d4a2208118a8798d43119d63b53e05
treebdffe5cfa63e7fe1fd6efa9a26a139cc01888210
parenta95be8f0e06b528c246b7b4f6cada557568017e2

frontend: rip out Decl dependencies

This incremental compilation logic will need to be reworked so that it does not depend on buried pointers - that is, long-lived pointers that are owned by non-top-level objects such as Decl. In the meantime, this fixes memory leaks since the memory management of these dependencies has bitrotted.

3 files changed, 2 insertions(+), 152 deletions(-)

src/Compilation.zig-1
......@@ -2266,7 +2266,6 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void
22662266 const decl_index = module.deletion_set.keys()[0];
22672267 const decl = module.declPtr(decl_index);
22682268 assert(decl.deletion_flag);
2269 assert(decl.dependants.count() == 0);
22702269 assert(decl.zir_decl_index != .none);
22712270
22722271 try module.clearDecl(decl_index, null);
src/Module.zig+2-117
......@@ -463,13 +463,6 @@ pub const Decl = struct {
463463 /// What kind of a declaration is this.
464464 kind: Kind,
465465
466 /// The shallow set of other decls whose typed_value could possibly change if this Decl's
467 /// typed_value is modified.
468 dependants: DepsTable = .{},
469 /// The shallow set of other decls whose typed_value changing indicates that this Decl's
470 /// typed_value may need to be regenerated.
471 dependencies: DepsTable = .{},
472
473466 pub const Kind = enum {
474467 @"usingnamespace",
475468 @"test",
......@@ -2626,8 +2619,6 @@ pub fn destroyDecl(mod: *Module, decl_index: Decl.Index) void {
26262619 mod.destroyNamespace(i);
26272620 }
26282621 }
2629 decl.dependants.deinit(gpa);
2630 decl.dependencies.deinit(gpa);
26312622 }
26322623
26332624 ip.destroyDecl(gpa, decl_index);
......@@ -3278,16 +3269,6 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void {
32783269 // prior to re-analysis.
32793270 try mod.deleteDeclExports(decl_index);
32803271
3281 // Dependencies will be re-discovered, so we remove them here prior to re-analysis.
3282 for (decl.dependencies.keys()) |dep_index| {
3283 const dep = mod.declPtr(dep_index);
3284 dep.removeDependant(decl_index);
3285 if (dep.dependants.count() == 0 and !dep.deletion_flag) {
3286 try mod.markDeclForDeletion(dep_index);
3287 }
3288 }
3289 decl.dependencies.clearRetainingCapacity();
3290
32913272 break :blk true;
32923273 },
32933274
......@@ -3331,33 +3312,8 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void {
33313312 };
33323313
33333314 if (subsequent_analysis) {
3334 // Update all dependents which have at least this level of dependency.
3335 // If our type remained the same and we're a function, only update
3336 // decls which depend on our body; otherwise, update all dependents.
3337 const update_level: Decl.DepType = if (!type_changed and decl.ty.zigTypeTag(mod) == .Fn) .function_body else .normal;
3338
3339 for (decl.dependants.keys(), decl.dependants.values()) |dep_index, dep_type| {
3340 if (@intFromEnum(dep_type) < @intFromEnum(update_level)) continue;
3341
3342 const dep = mod.declPtr(dep_index);
3343 switch (dep.analysis) {
3344 .unreferenced => unreachable,
3345 .in_progress => continue, // already doing analysis, ok
3346 .outdated => continue, // already queued for update
3347
3348 .file_failure,
3349 .dependency_failure,
3350 .sema_failure,
3351 .sema_failure_retryable,
3352 .liveness_failure,
3353 .codegen_failure,
3354 .codegen_failure_retryable,
3355 .complete,
3356 => if (dep.generation != mod.generation) {
3357 try mod.markOutdatedDecl(dep_index);
3358 },
3359 }
3360 }
3315 _ = type_changed;
3316 @panic("TODO re-implement incremental compilation");
33613317 }
33623318}
33633319
......@@ -3938,37 +3894,6 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !bool {
39383894 return type_changed;
39393895}
39403896
3941/// Returns the depender's index of the dependee.
3942pub fn declareDeclDependency(mod: *Module, depender_index: Decl.Index, dependee_index: Decl.Index) !void {
3943 return mod.declareDeclDependencyType(depender_index, dependee_index, .normal);
3944}
3945
3946/// Returns the depender's index of the dependee.
3947pub fn declareDeclDependencyType(mod: *Module, depender_index: Decl.Index, dependee_index: Decl.Index, dep_type: Decl.DepType) !void {
3948 if (depender_index == dependee_index) return;
3949
3950 const depender = mod.declPtr(depender_index);
3951 const dependee = mod.declPtr(dependee_index);
3952
3953 if (depender.dependencies.get(dependee_index)) |cur_type| {
3954 if (@intFromEnum(cur_type) >= @intFromEnum(dep_type)) {
3955 // We already have this dependency (or stricter) marked
3956 return;
3957 }
3958 }
3959
3960 if (dependee.deletion_flag) {
3961 dependee.deletion_flag = false;
3962 assert(mod.deletion_set.swapRemove(dependee_index));
3963 }
3964
3965 try depender.dependencies.ensureUnusedCapacity(mod.gpa, 1);
3966 try dependee.dependants.ensureUnusedCapacity(mod.gpa, 1);
3967
3968 dependee.dependants.putAssumeCapacity(depender_index, dep_type);
3969 depender.dependencies.putAssumeCapacity(dependee_index, dep_type);
3970}
3971
39723897pub const ImportFileResult = struct {
39733898 file: *File,
39743899 is_new: bool,
......@@ -4508,35 +4433,10 @@ pub fn clearDecl(
45084433 const decl = mod.declPtr(decl_index);
45094434
45104435 const gpa = mod.gpa;
4511 try mod.deletion_set.ensureUnusedCapacity(gpa, decl.dependencies.count());
45124436
45134437 if (outdated_decls) |map| {
45144438 _ = map.swapRemove(decl_index);
4515 try map.ensureUnusedCapacity(decl.dependants.count());
4516 }
4517
4518 // Remove itself from its dependencies.
4519 for (decl.dependencies.keys()) |dep_index| {
4520 const dep = mod.declPtr(dep_index);
4521 dep.removeDependant(decl_index);
4522 if (dep.dependants.count() == 0 and !dep.deletion_flag) {
4523 // We don't recursively perform a deletion here, because during the update,
4524 // another reference to it may turn up.
4525 dep.deletion_flag = true;
4526 mod.deletion_set.putAssumeCapacity(dep_index, {});
4527 }
4528 }
4529 decl.dependencies.clearRetainingCapacity();
4530
4531 // Anything that depends on this deleted decl needs to be re-analyzed.
4532 for (decl.dependants.keys()) |dep_index| {
4533 const dep = mod.declPtr(dep_index);
4534 dep.removeDependency(decl_index);
4535 if (outdated_decls) |map| {
4536 map.putAssumeCapacity(dep_index, {});
4537 }
45384439 }
4539 decl.dependants.clearRetainingCapacity();
45404440
45414441 if (mod.failed_decls.fetchSwapRemove(decl_index)) |kv| {
45424442 kv.value.destroy(gpa);
......@@ -4598,19 +4498,7 @@ fn markDeclForDeletion(mod: *Module, decl_index: Decl.Index) !void {
45984498/// Cancel the creation of an anon decl and delete any references to it.
45994499/// If other decls depend on this decl, they must be aborted first.
46004500pub fn abortAnonDecl(mod: *Module, decl_index: Decl.Index) void {
4601 const decl = mod.declPtr(decl_index);
4602
46034501 assert(!mod.declIsRoot(decl_index));
4604
4605 // An aborted decl must not have dependants -- they must have
4606 // been aborted first and removed from this list.
4607 assert(decl.dependants.count() == 0);
4608
4609 for (decl.dependencies.keys()) |dep_index| {
4610 const dep = mod.declPtr(dep_index);
4611 dep.removeDependant(decl_index);
4612 }
4613
46144502 mod.destroyDecl(decl_index);
46154503}
46164504
......@@ -5694,9 +5582,6 @@ pub fn populateTestFunctions(
56945582 .storage = .{ .elems = test_fn_vals },
56955583 } })).toValue(),
56965584 });
5697 for (array_decl_dependencies.items) |array_decl_dependency| {
5698 try mod.declareDeclDependency(array_decl_index, array_decl_dependency);
5699 }
57005585
57015586 break :d array_decl_index;
57025587 };
src/Sema.zig-34
......@@ -4006,7 +4006,6 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
40064006 .inferred_alloc_comptime => {
40074007 const iac = sema.air_instructions.items(.data)[ptr_inst].inferred_alloc_comptime;
40084008 const decl_index = iac.decl_index;
4009 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
40104009
40114010 const decl = mod.declPtr(decl_index);
40124011 if (iac.is_const) _ = try decl.internValue(mod);
......@@ -6411,7 +6410,6 @@ fn lookupInNamespace(
64116410 const namespace_decl_index = namespace.getDeclIndex(mod);
64126411 const namespace_decl = mod.declPtr(namespace_decl_index);
64136412 if (namespace_decl.analysis == .file_failure) {
6414 try mod.declareDeclDependency(sema.owner_decl_index, namespace_decl_index);
64156413 return error.AnalysisFail;
64166414 }
64176415
......@@ -6473,7 +6471,6 @@ fn lookupInNamespace(
64736471 0 => {},
64746472 1 => {
64756473 const decl_index = candidates.items[0];
6476 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
64776474 return decl_index;
64786475 },
64796476 else => {
......@@ -6491,14 +6488,9 @@ fn lookupInNamespace(
64916488 },
64926489 }
64936490 } else if (namespace.decls.getKeyAdapted(ident_name, Module.DeclAdapter{ .mod = mod })) |decl_index| {
6494 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
64956491 return decl_index;
64966492 }
64976493
6498 // TODO This dependency is too strong. Really, it should only be a dependency
6499 // on the non-existence of `ident_name` in the namespace. We can lessen the number of
6500 // outdated declarations by making this dependency more sophisticated.
6501 try mod.declareDeclDependency(sema.owner_decl_index, namespace_decl_index);
65026494 return null;
65036495}
65046496
......@@ -7318,8 +7310,6 @@ fn analyzeCall(
73187310 );
73197311 defer ics.deinit();
73207312
7321 try mod.declareDeclDependencyType(ics.callee().owner_decl_index, module_fn.owner_decl, .function_body);
7322
73237313 var child_block: Block = .{
73247314 .parent = null,
73257315 .sema = sema,
......@@ -16856,7 +16846,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1685616846 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1685716847 try ip.getOrPutString(gpa, "Fn"),
1685816848 )).?;
16859 try mod.declareDeclDependency(sema.owner_decl_index, fn_info_decl_index);
1686016849 try sema.ensureDeclAnalyzed(fn_info_decl_index);
1686116850 const fn_info_decl = mod.declPtr(fn_info_decl_index);
1686216851 const fn_info_ty = fn_info_decl.val.toType();
......@@ -16867,7 +16856,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1686716856 fn_info_ty.getNamespaceIndex(mod).unwrap().?,
1686816857 try ip.getOrPutString(gpa, "Param"),
1686916858 )).?;
16870 try mod.declareDeclDependency(sema.owner_decl_index, param_info_decl_index);
1687116859 try sema.ensureDeclAnalyzed(param_info_decl_index);
1687216860 const param_info_decl = mod.declPtr(param_info_decl_index);
1687316861 const param_info_ty = param_info_decl.val.toType();
......@@ -16967,7 +16955,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1696716955 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1696816956 try ip.getOrPutString(gpa, "Int"),
1696916957 )).?;
16970 try mod.declareDeclDependency(sema.owner_decl_index, int_info_decl_index);
1697116958 try sema.ensureDeclAnalyzed(int_info_decl_index);
1697216959 const int_info_decl = mod.declPtr(int_info_decl_index);
1697316960 const int_info_ty = int_info_decl.val.toType();
......@@ -16996,7 +16983,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1699616983 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1699716984 try ip.getOrPutString(gpa, "Float"),
1699816985 )).?;
16999 try mod.declareDeclDependency(sema.owner_decl_index, float_info_decl_index);
1700016986 try sema.ensureDeclAnalyzed(float_info_decl_index);
1700116987 const float_info_decl = mod.declPtr(float_info_decl_index);
1700216988 const float_info_ty = float_info_decl.val.toType();
......@@ -17029,7 +17015,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1702917015 (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?,
1703017016 try ip.getOrPutString(gpa, "Pointer"),
1703117017 )).?;
17032 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
1703317018 try sema.ensureDeclAnalyzed(decl_index);
1703417019 const decl = mod.declPtr(decl_index);
1703517020 break :t decl.val.toType();
......@@ -17041,7 +17026,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1704117026 pointer_ty.getNamespaceIndex(mod).unwrap().?,
1704217027 try ip.getOrPutString(gpa, "Size"),
1704317028 )).?;
17044 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
1704517029 try sema.ensureDeclAnalyzed(decl_index);
1704617030 const decl = mod.declPtr(decl_index);
1704717031 break :t decl.val.toType();
......@@ -17085,7 +17069,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1708517069 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1708617070 try ip.getOrPutString(gpa, "Array"),
1708717071 )).?;
17088 try mod.declareDeclDependency(sema.owner_decl_index, array_field_ty_decl_index);
1708917072 try sema.ensureDeclAnalyzed(array_field_ty_decl_index);
1709017073 const array_field_ty_decl = mod.declPtr(array_field_ty_decl_index);
1709117074 break :t array_field_ty_decl.val.toType();
......@@ -17117,7 +17100,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1711717100 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1711817101 try ip.getOrPutString(gpa, "Vector"),
1711917102 )).?;
17120 try mod.declareDeclDependency(sema.owner_decl_index, vector_field_ty_decl_index);
1712117103 try sema.ensureDeclAnalyzed(vector_field_ty_decl_index);
1712217104 const vector_field_ty_decl = mod.declPtr(vector_field_ty_decl_index);
1712317105 break :t vector_field_ty_decl.val.toType();
......@@ -17147,7 +17129,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1714717129 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1714817130 try ip.getOrPutString(gpa, "Optional"),
1714917131 )).?;
17150 try mod.declareDeclDependency(sema.owner_decl_index, optional_field_ty_decl_index);
1715117132 try sema.ensureDeclAnalyzed(optional_field_ty_decl_index);
1715217133 const optional_field_ty_decl = mod.declPtr(optional_field_ty_decl_index);
1715317134 break :t optional_field_ty_decl.val.toType();
......@@ -17175,7 +17156,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1717517156 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1717617157 try ip.getOrPutString(gpa, "Error"),
1717717158 )).?;
17178 try mod.declareDeclDependency(sema.owner_decl_index, set_field_ty_decl_index);
1717917159 try sema.ensureDeclAnalyzed(set_field_ty_decl_index);
1718017160 const set_field_ty_decl = mod.declPtr(set_field_ty_decl_index);
1718117161 break :t set_field_ty_decl.val.toType();
......@@ -17274,7 +17254,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1727417254 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1727517255 try ip.getOrPutString(gpa, "ErrorUnion"),
1727617256 )).?;
17277 try mod.declareDeclDependency(sema.owner_decl_index, error_union_field_ty_decl_index);
1727817257 try sema.ensureDeclAnalyzed(error_union_field_ty_decl_index);
1727917258 const error_union_field_ty_decl = mod.declPtr(error_union_field_ty_decl_index);
1728017259 break :t error_union_field_ty_decl.val.toType();
......@@ -17305,7 +17284,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1730517284 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1730617285 try ip.getOrPutString(gpa, "EnumField"),
1730717286 )).?;
17308 try mod.declareDeclDependency(sema.owner_decl_index, enum_field_ty_decl_index);
1730917287 try sema.ensureDeclAnalyzed(enum_field_ty_decl_index);
1731017288 const enum_field_ty_decl = mod.declPtr(enum_field_ty_decl_index);
1731117289 break :t enum_field_ty_decl.val.toType();
......@@ -17390,7 +17368,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1739017368 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1739117369 try ip.getOrPutString(gpa, "Enum"),
1739217370 )).?;
17393 try mod.declareDeclDependency(sema.owner_decl_index, type_enum_ty_decl_index);
1739417371 try sema.ensureDeclAnalyzed(type_enum_ty_decl_index);
1739517372 const type_enum_ty_decl = mod.declPtr(type_enum_ty_decl_index);
1739617373 break :t type_enum_ty_decl.val.toType();
......@@ -17423,7 +17400,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1742317400 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1742417401 try ip.getOrPutString(gpa, "Union"),
1742517402 )).?;
17426 try mod.declareDeclDependency(sema.owner_decl_index, type_union_ty_decl_index);
1742717403 try sema.ensureDeclAnalyzed(type_union_ty_decl_index);
1742817404 const type_union_ty_decl = mod.declPtr(type_union_ty_decl_index);
1742917405 break :t type_union_ty_decl.val.toType();
......@@ -17436,7 +17412,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1743617412 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1743717413 try ip.getOrPutString(gpa, "UnionField"),
1743817414 )).?;
17439 try mod.declareDeclDependency(sema.owner_decl_index, union_field_ty_decl_index);
1744017415 try sema.ensureDeclAnalyzed(union_field_ty_decl_index);
1744117416 const union_field_ty_decl = mod.declPtr(union_field_ty_decl_index);
1744217417 break :t union_field_ty_decl.val.toType();
......@@ -17531,7 +17506,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1753117506 (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?,
1753217507 try ip.getOrPutString(gpa, "ContainerLayout"),
1753317508 )).?;
17534 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
1753517509 try sema.ensureDeclAnalyzed(decl_index);
1753617510 const decl = mod.declPtr(decl_index);
1753717511 break :t decl.val.toType();
......@@ -17565,7 +17539,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1756517539 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1756617540 try ip.getOrPutString(gpa, "Struct"),
1756717541 )).?;
17568 try mod.declareDeclDependency(sema.owner_decl_index, type_struct_ty_decl_index);
1756917542 try sema.ensureDeclAnalyzed(type_struct_ty_decl_index);
1757017543 const type_struct_ty_decl = mod.declPtr(type_struct_ty_decl_index);
1757117544 break :t type_struct_ty_decl.val.toType();
......@@ -17578,7 +17551,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1757817551 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1757917552 try ip.getOrPutString(gpa, "StructField"),
1758017553 )).?;
17581 try mod.declareDeclDependency(sema.owner_decl_index, struct_field_ty_decl_index);
1758217554 try sema.ensureDeclAnalyzed(struct_field_ty_decl_index);
1758317555 const struct_field_ty_decl = mod.declPtr(struct_field_ty_decl_index);
1758417556 break :t struct_field_ty_decl.val.toType();
......@@ -17751,7 +17723,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1775117723 (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?,
1775217724 try ip.getOrPutString(gpa, "ContainerLayout"),
1775317725 )).?;
17754 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
1775517726 try sema.ensureDeclAnalyzed(decl_index);
1775617727 const decl = mod.declPtr(decl_index);
1775717728 break :t decl.val.toType();
......@@ -17788,7 +17759,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1778817759 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1778917760 try ip.getOrPutString(gpa, "Opaque"),
1779017761 )).?;
17791 try mod.declareDeclDependency(sema.owner_decl_index, type_opaque_ty_decl_index);
1779217762 try sema.ensureDeclAnalyzed(type_opaque_ty_decl_index);
1779317763 const type_opaque_ty_decl = mod.declPtr(type_opaque_ty_decl_index);
1779417764 break :t type_opaque_ty_decl.val.toType();
......@@ -17832,7 +17802,6 @@ fn typeInfoDecls(
1783217802 type_info_ty.getNamespaceIndex(mod).unwrap().?,
1783317803 try mod.intern_pool.getOrPutString(gpa, "Declaration"),
1783417804 )).?;
17835 try mod.declareDeclDependency(sema.owner_decl_index, declaration_ty_decl_index);
1783617805 try sema.ensureDeclAnalyzed(declaration_ty_decl_index);
1783717806 const declaration_ty_decl = mod.declPtr(declaration_ty_decl_index);
1783817807 break :t declaration_ty_decl.val.toType();
......@@ -25237,7 +25206,6 @@ fn zirBuiltinExtern(
2523725206 new_decl.generation = mod.generation;
2523825207 }
2523925208
25240 try mod.declareDeclDependency(sema.owner_decl_index, new_decl_index);
2524125209 try sema.ensureDeclAnalyzed(new_decl_index);
2524225210
2524325211 return Air.internedToRef((try mod.getCoerced((try mod.intern(.{ .ptr = .{
......@@ -31640,7 +31608,6 @@ fn analyzeDeclRef(sema: *Sema, decl_index: Decl.Index) CompileError!Air.Inst.Ref
3164031608/// this function with `analyze_fn_body` set to true.
3164131609fn analyzeDeclRefInner(sema: *Sema, decl_index: Decl.Index, analyze_fn_body: bool) CompileError!Air.Inst.Ref {
3164231610 const mod = sema.mod;
31643 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
3164431611 try sema.ensureDeclAnalyzed(decl_index);
3164531612
3164631613 const decl = mod.declPtr(decl_index);
......@@ -36895,7 +36862,6 @@ fn analyzeComptimeAlloc(
3689536862 decl.alignment = alignment;
3689636863
3689736864 try sema.comptime_mutable_decls.append(decl_index);
36898 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
3689936865 return Air.internedToRef((try mod.intern(.{ .ptr = .{
3690036866 .ty = ptr_type.toIntern(),
3690136867 .addr = .{ .mut_decl = .{