| ... | ... | @@ -4006,7 +4006,6 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com |
| 4006 | 4006 | .inferred_alloc_comptime => { |
| 4007 | 4007 | const iac = sema.air_instructions.items(.data)[ptr_inst].inferred_alloc_comptime; |
| 4008 | 4008 | const decl_index = iac.decl_index; |
| 4009 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 4010 | 4009 | |
| 4011 | 4010 | const decl = mod.declPtr(decl_index); |
| 4012 | 4011 | if (iac.is_const) _ = try decl.internValue(mod); |
| ... | ... | @@ -6411,7 +6410,6 @@ fn lookupInNamespace( |
| 6411 | 6410 | const namespace_decl_index = namespace.getDeclIndex(mod); |
| 6412 | 6411 | const namespace_decl = mod.declPtr(namespace_decl_index); |
| 6413 | 6412 | if (namespace_decl.analysis == .file_failure) { |
| 6414 | | try mod.declareDeclDependency(sema.owner_decl_index, namespace_decl_index); |
| 6415 | 6413 | return error.AnalysisFail; |
| 6416 | 6414 | } |
| 6417 | 6415 | |
| ... | ... | @@ -6473,7 +6471,6 @@ fn lookupInNamespace( |
| 6473 | 6471 | 0 => {}, |
| 6474 | 6472 | 1 => { |
| 6475 | 6473 | const decl_index = candidates.items[0]; |
| 6476 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 6477 | 6474 | return decl_index; |
| 6478 | 6475 | }, |
| 6479 | 6476 | else => { |
| ... | ... | @@ -6491,14 +6488,9 @@ fn lookupInNamespace( |
| 6491 | 6488 | }, |
| 6492 | 6489 | } |
| 6493 | 6490 | } else if (namespace.decls.getKeyAdapted(ident_name, Module.DeclAdapter{ .mod = mod })) |decl_index| { |
| 6494 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 6495 | 6491 | return decl_index; |
| 6496 | 6492 | } |
| 6497 | 6493 | |
| 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); |
| 6502 | 6494 | return null; |
| 6503 | 6495 | } |
| 6504 | 6496 | |
| ... | ... | @@ -7318,8 +7310,6 @@ fn analyzeCall( |
| 7318 | 7310 | ); |
| 7319 | 7311 | defer ics.deinit(); |
| 7320 | 7312 | |
| 7321 | | try mod.declareDeclDependencyType(ics.callee().owner_decl_index, module_fn.owner_decl, .function_body); |
| 7322 | | |
| 7323 | 7313 | var child_block: Block = .{ |
| 7324 | 7314 | .parent = null, |
| 7325 | 7315 | .sema = sema, |
| ... | ... | @@ -16856,7 +16846,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 16856 | 16846 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 16857 | 16847 | try ip.getOrPutString(gpa, "Fn"), |
| 16858 | 16848 | )).?; |
| 16859 | | try mod.declareDeclDependency(sema.owner_decl_index, fn_info_decl_index); |
| 16860 | 16849 | try sema.ensureDeclAnalyzed(fn_info_decl_index); |
| 16861 | 16850 | const fn_info_decl = mod.declPtr(fn_info_decl_index); |
| 16862 | 16851 | 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 |
| 16867 | 16856 | fn_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 16868 | 16857 | try ip.getOrPutString(gpa, "Param"), |
| 16869 | 16858 | )).?; |
| 16870 | | try mod.declareDeclDependency(sema.owner_decl_index, param_info_decl_index); |
| 16871 | 16859 | try sema.ensureDeclAnalyzed(param_info_decl_index); |
| 16872 | 16860 | const param_info_decl = mod.declPtr(param_info_decl_index); |
| 16873 | 16861 | 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 |
| 16967 | 16955 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 16968 | 16956 | try ip.getOrPutString(gpa, "Int"), |
| 16969 | 16957 | )).?; |
| 16970 | | try mod.declareDeclDependency(sema.owner_decl_index, int_info_decl_index); |
| 16971 | 16958 | try sema.ensureDeclAnalyzed(int_info_decl_index); |
| 16972 | 16959 | const int_info_decl = mod.declPtr(int_info_decl_index); |
| 16973 | 16960 | 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 |
| 16996 | 16983 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 16997 | 16984 | try ip.getOrPutString(gpa, "Float"), |
| 16998 | 16985 | )).?; |
| 16999 | | try mod.declareDeclDependency(sema.owner_decl_index, float_info_decl_index); |
| 17000 | 16986 | try sema.ensureDeclAnalyzed(float_info_decl_index); |
| 17001 | 16987 | const float_info_decl = mod.declPtr(float_info_decl_index); |
| 17002 | 16988 | 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 |
| 17029 | 17015 | (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?, |
| 17030 | 17016 | try ip.getOrPutString(gpa, "Pointer"), |
| 17031 | 17017 | )).?; |
| 17032 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 17033 | 17018 | try sema.ensureDeclAnalyzed(decl_index); |
| 17034 | 17019 | const decl = mod.declPtr(decl_index); |
| 17035 | 17020 | break :t decl.val.toType(); |
| ... | ... | @@ -17041,7 +17026,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17041 | 17026 | pointer_ty.getNamespaceIndex(mod).unwrap().?, |
| 17042 | 17027 | try ip.getOrPutString(gpa, "Size"), |
| 17043 | 17028 | )).?; |
| 17044 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 17045 | 17029 | try sema.ensureDeclAnalyzed(decl_index); |
| 17046 | 17030 | const decl = mod.declPtr(decl_index); |
| 17047 | 17031 | break :t decl.val.toType(); |
| ... | ... | @@ -17085,7 +17069,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17085 | 17069 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17086 | 17070 | try ip.getOrPutString(gpa, "Array"), |
| 17087 | 17071 | )).?; |
| 17088 | | try mod.declareDeclDependency(sema.owner_decl_index, array_field_ty_decl_index); |
| 17089 | 17072 | try sema.ensureDeclAnalyzed(array_field_ty_decl_index); |
| 17090 | 17073 | const array_field_ty_decl = mod.declPtr(array_field_ty_decl_index); |
| 17091 | 17074 | break :t array_field_ty_decl.val.toType(); |
| ... | ... | @@ -17117,7 +17100,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17117 | 17100 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17118 | 17101 | try ip.getOrPutString(gpa, "Vector"), |
| 17119 | 17102 | )).?; |
| 17120 | | try mod.declareDeclDependency(sema.owner_decl_index, vector_field_ty_decl_index); |
| 17121 | 17103 | try sema.ensureDeclAnalyzed(vector_field_ty_decl_index); |
| 17122 | 17104 | const vector_field_ty_decl = mod.declPtr(vector_field_ty_decl_index); |
| 17123 | 17105 | break :t vector_field_ty_decl.val.toType(); |
| ... | ... | @@ -17147,7 +17129,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17147 | 17129 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17148 | 17130 | try ip.getOrPutString(gpa, "Optional"), |
| 17149 | 17131 | )).?; |
| 17150 | | try mod.declareDeclDependency(sema.owner_decl_index, optional_field_ty_decl_index); |
| 17151 | 17132 | try sema.ensureDeclAnalyzed(optional_field_ty_decl_index); |
| 17152 | 17133 | const optional_field_ty_decl = mod.declPtr(optional_field_ty_decl_index); |
| 17153 | 17134 | break :t optional_field_ty_decl.val.toType(); |
| ... | ... | @@ -17175,7 +17156,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17175 | 17156 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17176 | 17157 | try ip.getOrPutString(gpa, "Error"), |
| 17177 | 17158 | )).?; |
| 17178 | | try mod.declareDeclDependency(sema.owner_decl_index, set_field_ty_decl_index); |
| 17179 | 17159 | try sema.ensureDeclAnalyzed(set_field_ty_decl_index); |
| 17180 | 17160 | const set_field_ty_decl = mod.declPtr(set_field_ty_decl_index); |
| 17181 | 17161 | break :t set_field_ty_decl.val.toType(); |
| ... | ... | @@ -17274,7 +17254,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17274 | 17254 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17275 | 17255 | try ip.getOrPutString(gpa, "ErrorUnion"), |
| 17276 | 17256 | )).?; |
| 17277 | | try mod.declareDeclDependency(sema.owner_decl_index, error_union_field_ty_decl_index); |
| 17278 | 17257 | try sema.ensureDeclAnalyzed(error_union_field_ty_decl_index); |
| 17279 | 17258 | const error_union_field_ty_decl = mod.declPtr(error_union_field_ty_decl_index); |
| 17280 | 17259 | 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 |
| 17305 | 17284 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17306 | 17285 | try ip.getOrPutString(gpa, "EnumField"), |
| 17307 | 17286 | )).?; |
| 17308 | | try mod.declareDeclDependency(sema.owner_decl_index, enum_field_ty_decl_index); |
| 17309 | 17287 | try sema.ensureDeclAnalyzed(enum_field_ty_decl_index); |
| 17310 | 17288 | const enum_field_ty_decl = mod.declPtr(enum_field_ty_decl_index); |
| 17311 | 17289 | break :t enum_field_ty_decl.val.toType(); |
| ... | ... | @@ -17390,7 +17368,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17390 | 17368 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17391 | 17369 | try ip.getOrPutString(gpa, "Enum"), |
| 17392 | 17370 | )).?; |
| 17393 | | try mod.declareDeclDependency(sema.owner_decl_index, type_enum_ty_decl_index); |
| 17394 | 17371 | try sema.ensureDeclAnalyzed(type_enum_ty_decl_index); |
| 17395 | 17372 | const type_enum_ty_decl = mod.declPtr(type_enum_ty_decl_index); |
| 17396 | 17373 | break :t type_enum_ty_decl.val.toType(); |
| ... | ... | @@ -17423,7 +17400,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17423 | 17400 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17424 | 17401 | try ip.getOrPutString(gpa, "Union"), |
| 17425 | 17402 | )).?; |
| 17426 | | try mod.declareDeclDependency(sema.owner_decl_index, type_union_ty_decl_index); |
| 17427 | 17403 | try sema.ensureDeclAnalyzed(type_union_ty_decl_index); |
| 17428 | 17404 | const type_union_ty_decl = mod.declPtr(type_union_ty_decl_index); |
| 17429 | 17405 | break :t type_union_ty_decl.val.toType(); |
| ... | ... | @@ -17436,7 +17412,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17436 | 17412 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17437 | 17413 | try ip.getOrPutString(gpa, "UnionField"), |
| 17438 | 17414 | )).?; |
| 17439 | | try mod.declareDeclDependency(sema.owner_decl_index, union_field_ty_decl_index); |
| 17440 | 17415 | try sema.ensureDeclAnalyzed(union_field_ty_decl_index); |
| 17441 | 17416 | const union_field_ty_decl = mod.declPtr(union_field_ty_decl_index); |
| 17442 | 17417 | break :t union_field_ty_decl.val.toType(); |
| ... | ... | @@ -17531,7 +17506,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17531 | 17506 | (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?, |
| 17532 | 17507 | try ip.getOrPutString(gpa, "ContainerLayout"), |
| 17533 | 17508 | )).?; |
| 17534 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 17535 | 17509 | try sema.ensureDeclAnalyzed(decl_index); |
| 17536 | 17510 | const decl = mod.declPtr(decl_index); |
| 17537 | 17511 | break :t decl.val.toType(); |
| ... | ... | @@ -17565,7 +17539,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17565 | 17539 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17566 | 17540 | try ip.getOrPutString(gpa, "Struct"), |
| 17567 | 17541 | )).?; |
| 17568 | | try mod.declareDeclDependency(sema.owner_decl_index, type_struct_ty_decl_index); |
| 17569 | 17542 | try sema.ensureDeclAnalyzed(type_struct_ty_decl_index); |
| 17570 | 17543 | const type_struct_ty_decl = mod.declPtr(type_struct_ty_decl_index); |
| 17571 | 17544 | break :t type_struct_ty_decl.val.toType(); |
| ... | ... | @@ -17578,7 +17551,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17578 | 17551 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17579 | 17552 | try ip.getOrPutString(gpa, "StructField"), |
| 17580 | 17553 | )).?; |
| 17581 | | try mod.declareDeclDependency(sema.owner_decl_index, struct_field_ty_decl_index); |
| 17582 | 17554 | try sema.ensureDeclAnalyzed(struct_field_ty_decl_index); |
| 17583 | 17555 | const struct_field_ty_decl = mod.declPtr(struct_field_ty_decl_index); |
| 17584 | 17556 | break :t struct_field_ty_decl.val.toType(); |
| ... | ... | @@ -17751,7 +17723,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17751 | 17723 | (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?, |
| 17752 | 17724 | try ip.getOrPutString(gpa, "ContainerLayout"), |
| 17753 | 17725 | )).?; |
| 17754 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 17755 | 17726 | try sema.ensureDeclAnalyzed(decl_index); |
| 17756 | 17727 | const decl = mod.declPtr(decl_index); |
| 17757 | 17728 | break :t decl.val.toType(); |
| ... | ... | @@ -17788,7 +17759,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 17788 | 17759 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17789 | 17760 | try ip.getOrPutString(gpa, "Opaque"), |
| 17790 | 17761 | )).?; |
| 17791 | | try mod.declareDeclDependency(sema.owner_decl_index, type_opaque_ty_decl_index); |
| 17792 | 17762 | try sema.ensureDeclAnalyzed(type_opaque_ty_decl_index); |
| 17793 | 17763 | const type_opaque_ty_decl = mod.declPtr(type_opaque_ty_decl_index); |
| 17794 | 17764 | break :t type_opaque_ty_decl.val.toType(); |
| ... | ... | @@ -17832,7 +17802,6 @@ fn typeInfoDecls( |
| 17832 | 17802 | type_info_ty.getNamespaceIndex(mod).unwrap().?, |
| 17833 | 17803 | try mod.intern_pool.getOrPutString(gpa, "Declaration"), |
| 17834 | 17804 | )).?; |
| 17835 | | try mod.declareDeclDependency(sema.owner_decl_index, declaration_ty_decl_index); |
| 17836 | 17805 | try sema.ensureDeclAnalyzed(declaration_ty_decl_index); |
| 17837 | 17806 | const declaration_ty_decl = mod.declPtr(declaration_ty_decl_index); |
| 17838 | 17807 | break :t declaration_ty_decl.val.toType(); |
| ... | ... | @@ -25237,7 +25206,6 @@ fn zirBuiltinExtern( |
| 25237 | 25206 | new_decl.generation = mod.generation; |
| 25238 | 25207 | } |
| 25239 | 25208 | |
| 25240 | | try mod.declareDeclDependency(sema.owner_decl_index, new_decl_index); |
| 25241 | 25209 | try sema.ensureDeclAnalyzed(new_decl_index); |
| 25242 | 25210 | |
| 25243 | 25211 | 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 |
| 31640 | 31608 | /// this function with `analyze_fn_body` set to true. |
| 31641 | 31609 | fn analyzeDeclRefInner(sema: *Sema, decl_index: Decl.Index, analyze_fn_body: bool) CompileError!Air.Inst.Ref { |
| 31642 | 31610 | const mod = sema.mod; |
| 31643 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 31644 | 31611 | try sema.ensureDeclAnalyzed(decl_index); |
| 31645 | 31612 | |
| 31646 | 31613 | const decl = mod.declPtr(decl_index); |
| ... | ... | @@ -36895,7 +36862,6 @@ fn analyzeComptimeAlloc( |
| 36895 | 36862 | decl.alignment = alignment; |
| 36896 | 36863 | |
| 36897 | 36864 | try sema.comptime_mutable_decls.append(decl_index); |
| 36898 | | try mod.declareDeclDependency(sema.owner_decl_index, decl_index); |
| 36899 | 36865 | return Air.internedToRef((try mod.intern(.{ .ptr = .{ |
| 36900 | 36866 | .ty = ptr_type.toIntern(), |
| 36901 | 36867 | .addr = .{ .mut_decl = .{ |