| ... | @@ -762,14 +762,14 @@ pub const Namespace = struct { | ... | @@ -762,14 +762,14 @@ pub const Namespace = struct { |
| 762 | zcu: *Zcu, | 762 | zcu: *Zcu, |
| 763 | | 763 | |
| 764 | pub fn hash(ctx: @This(), decl_index: Decl.Index) u32 { | 764 | pub fn hash(ctx: @This(), decl_index: Decl.Index) u32 { |
| 765 | const decl = ctx.module.declPtr(decl_index); | 765 | const decl = ctx.zcu.declPtr(decl_index); |
| 766 | return std.hash.uint32(@intFromEnum(decl.name)); | 766 | return std.hash.uint32(@intFromEnum(decl.name)); |
| 767 | } | 767 | } |
| 768 | | 768 | |
| 769 | pub fn eql(ctx: @This(), a_decl_index: Decl.Index, b_decl_index: Decl.Index, b_index: usize) bool { | 769 | pub fn eql(ctx: @This(), a_decl_index: Decl.Index, b_decl_index: Decl.Index, b_index: usize) bool { |
| 770 | _ = b_index; | 770 | _ = b_index; |
| 771 | const a_decl = ctx.module.declPtr(a_decl_index); | 771 | const a_decl = ctx.zcu.declPtr(a_decl_index); |
| 772 | const b_decl = ctx.module.declPtr(b_decl_index); | 772 | const b_decl = ctx.zcu.declPtr(b_decl_index); |
| 773 | return a_decl.name == b_decl.name; | 773 | return a_decl.name == b_decl.name; |
| 774 | } | 774 | } |
| 775 | }; | 775 | }; |
| ... | @@ -2655,7 +2655,7 @@ pub fn markDependeeOutdated(zcu: *Zcu, dependee: InternPool.Dependee) !void { | ... | @@ -2655,7 +2655,7 @@ pub fn markDependeeOutdated(zcu: *Zcu, dependee: InternPool.Dependee) !void { |
| 2655 | if (opt_po_entry) |e| e.value else 0, | 2655 | if (opt_po_entry) |e| e.value else 0, |
| 2656 | ); | 2656 | ); |
| 2657 | log.debug("outdated: {}", .{depender}); | 2657 | log.debug("outdated: {}", .{depender}); |
| 2658 | if (opt_po_entry != null) { | 2658 | if (opt_po_entry == null) { |
| 2659 | // This is a new entry with no PO dependencies. | 2659 | // This is a new entry with no PO dependencies. |
| 2660 | try zcu.outdated_ready.put(zcu.gpa, depender, {}); | 2660 | try zcu.outdated_ready.put(zcu.gpa, depender, {}); |
| 2661 | } | 2661 | } |
| ... | @@ -2989,10 +2989,10 @@ pub fn mapOldZirToNew( | ... | @@ -2989,10 +2989,10 @@ pub fn mapOldZirToNew( |
| 2989 | | 2989 | |
| 2990 | /// Like `ensureDeclAnalyzed`, but the Decl is a file's root Decl. | 2990 | /// Like `ensureDeclAnalyzed`, but the Decl is a file's root Decl. |
| 2991 | pub fn ensureFileAnalyzed(zcu: *Zcu, file: *File) SemaError!void { | 2991 | pub fn ensureFileAnalyzed(zcu: *Zcu, file: *File) SemaError!void { |
| 2992 | if (file.root_decl == .none) { | 2992 | if (file.root_decl.unwrap()) |existing_root| { |
| 2993 | return zcu.semaFile(file); | 2993 | return zcu.ensureDeclAnalyzed(existing_root); |
| 2994 | } else { | 2994 | } else { |
| 2995 | return zcu.ensureDeclAnalyzed(file.root_decl); | 2995 | return zcu.semaFile(file); |
| 2996 | } | 2996 | } |
| 2997 | } | 2997 | } |
| 2998 | | 2998 | |
| ... | @@ -3006,6 +3006,11 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void { | ... | @@ -3006,6 +3006,11 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void { |
| 3006 | | 3006 | |
| 3007 | const decl = mod.declPtr(decl_index); | 3007 | const decl = mod.declPtr(decl_index); |
| 3008 | | 3008 | |
| | 3009 | log.debug("ensureDeclAnalyzed '{d}' (name '{}')", .{ |
| | 3010 | @intFromEnum(decl_index), |
| | 3011 | decl.name.fmt(&mod.intern_pool), |
| | 3012 | }); |
| | 3013 | |
| 3009 | // Determine whether or not this Decl is outdated, i.e. requires re-analysis | 3014 | // Determine whether or not this Decl is outdated, i.e. requires re-analysis |
| 3010 | // even if `complete`. If a Decl is PO, we pessismistically assume that it | 3015 | // even if `complete`. If a Decl is PO, we pessismistically assume that it |
| 3011 | // *does* require re-analysis, to ensure that the Decl is definitely | 3016 | // *does* require re-analysis, to ensure that the Decl is definitely |
| ... | @@ -3099,11 +3104,13 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void { | ... | @@ -3099,11 +3104,13 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl_index: Decl.Index) SemaError!void { |
| 3099 | // TODO: we do not yet have separate dependencies for decl values vs types. | 3104 | // TODO: we do not yet have separate dependencies for decl values vs types. |
| 3100 | if (decl_was_outdated) { | 3105 | if (decl_was_outdated) { |
| 3101 | if (sema_result.invalidate_decl_val or sema_result.invalidate_decl_ref) { | 3106 | if (sema_result.invalidate_decl_val or sema_result.invalidate_decl_ref) { |
| | 3107 | log.debug("Decl tv invalidated ('{d}')", .{@intFromEnum(decl_index)}); |
| 3102 | // This dependency was marked as PO, meaning dependees were waiting | 3108 | // This dependency was marked as PO, meaning dependees were waiting |
| 3103 | // on its analysis result, and it has turned out to be outdated. | 3109 | // on its analysis result, and it has turned out to be outdated. |
| 3104 | // Update dependees accordingly. | 3110 | // Update dependees accordingly. |
| 3105 | try mod.markDependeeOutdated(.{ .decl_val = decl_index }); | 3111 | try mod.markDependeeOutdated(.{ .decl_val = decl_index }); |
| 3106 | } else { | 3112 | } else { |
| | 3113 | log.debug("Decl tv up-to-date ('{d}')", .{@intFromEnum(decl_index)}); |
| 3107 | // This dependency was previously PO, but turned out to be up-to-date. | 3114 | // This dependency was previously PO, but turned out to be up-to-date. |
| 3108 | // We do not need to queue successive analysis. | 3115 | // We do not need to queue successive analysis. |
| 3109 | try mod.markPoDependeeUpToDate(.{ .decl_val = decl_index }); | 3116 | try mod.markPoDependeeUpToDate(.{ .decl_val = decl_index }); |
| ... | @@ -3115,11 +3122,31 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError | ... | @@ -3115,11 +3122,31 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError |
| 3115 | const tracy = trace(@src()); | 3122 | const tracy = trace(@src()); |
| 3116 | defer tracy.end(); | 3123 | defer tracy.end(); |
| 3117 | | 3124 | |
| | 3125 | const gpa = zcu.gpa; |
| 3118 | const ip = &zcu.intern_pool; | 3126 | const ip = &zcu.intern_pool; |
| 3119 | const func = zcu.funcInfo(func_index); | 3127 | const func = zcu.funcInfo(func_index); |
| 3120 | const decl_index = func.owner_decl; | 3128 | const decl_index = func.owner_decl; |
| 3121 | const decl = zcu.declPtr(decl_index); | 3129 | const decl = zcu.declPtr(decl_index); |
| 3122 | | 3130 | |
| | 3131 | log.debug("ensureFuncBodyAnalyzed '{d}' (instance of '{}')", .{ |
| | 3132 | @intFromEnum(func_index), |
| | 3133 | decl.name.fmt(ip), |
| | 3134 | }); |
| | 3135 | |
| | 3136 | // First, our owner decl must be up-to-date. This will always be the case |
| | 3137 | // during the first update, but may not on successive updates if we happen |
| | 3138 | // to get analyzed before our parent decl. |
| | 3139 | try zcu.ensureDeclAnalyzed(decl_index); |
| | 3140 | |
| | 3141 | // On an update, it's possible this function changed such that our owner |
| | 3142 | // decl now refers to a different function, making this one orphaned. If |
| | 3143 | // that's the case, we should remove this function from the binary. |
| | 3144 | if (decl.val.ip_index != func_index) { |
| | 3145 | ip.removeDependenciesForDepender(gpa, InternPool.Depender.wrap(.{ .func = func_index })); |
| | 3146 | ip.remove(func_index); |
| | 3147 | @panic("TODO: remove orphaned function from binary"); |
| | 3148 | } |
| | 3149 | |
| 3123 | switch (decl.analysis) { | 3150 | switch (decl.analysis) { |
| 3124 | .unreferenced => unreachable, | 3151 | .unreferenced => unreachable, |
| 3125 | .in_progress => unreachable, | 3152 | .in_progress => unreachable, |
| ... | @@ -3143,7 +3170,7 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError | ... | @@ -3143,7 +3170,7 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError |
| 3143 | } | 3170 | } |
| 3144 | | 3171 | |
| 3145 | switch (func.analysis(ip).state) { | 3172 | switch (func.analysis(ip).state) { |
| 3146 | .success, | 3173 | .success => if (!was_outdated) return, |
| 3147 | .sema_failure, | 3174 | .sema_failure, |
| 3148 | .dependency_failure, | 3175 | .dependency_failure, |
| 3149 | .codegen_failure, | 3176 | .codegen_failure, |
| ... | @@ -3153,7 +3180,10 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError | ... | @@ -3153,7 +3180,10 @@ pub fn ensureFuncBodyAnalyzed(zcu: *Zcu, func_index: InternPool.Index) SemaError |
| 3153 | .inline_only => unreachable, // don't queue work for this | 3180 | .inline_only => unreachable, // don't queue work for this |
| 3154 | } | 3181 | } |
| 3155 | | 3182 | |
| 3156 | const gpa = zcu.gpa; | 3183 | log.debug("analyze and generate fn body '{d}'; reason='{s}'", .{ |
| | 3184 | @intFromEnum(func_index), |
| | 3185 | if (was_outdated) "outdated" else "never analyzed", |
| | 3186 | }); |
| 3157 | | 3187 | |
| 3158 | var tmp_arena = std.heap.ArenaAllocator.init(gpa); | 3188 | var tmp_arena = std.heap.ArenaAllocator.init(gpa); |
| 3159 | defer tmp_arena.deinit(); | 3189 | defer tmp_arena.deinit(); |
| ... | @@ -3311,7 +3341,9 @@ pub fn ensureFuncBodyAnalysisQueued(mod: *Module, func_index: InternPool.Index) | ... | @@ -3311,7 +3341,9 @@ pub fn ensureFuncBodyAnalysisQueued(mod: *Module, func_index: InternPool.Index) |
| 3311 | /// https://github.com/ziglang/zig/issues/14307 | 3341 | /// https://github.com/ziglang/zig/issues/14307 |
| 3312 | pub fn semaPkg(mod: *Module, pkg: *Package.Module) !void { | 3342 | pub fn semaPkg(mod: *Module, pkg: *Package.Module) !void { |
| 3313 | const file = (try mod.importPkg(pkg)).file; | 3343 | const file = (try mod.importPkg(pkg)).file; |
| 3314 | return mod.semaFile(file); | 3344 | if (file.root_decl == .none) { |
| | 3345 | return mod.semaFile(file); |
| | 3346 | } |
| 3315 | } | 3347 | } |
| 3316 | | 3348 | |
| 3317 | fn getFileRootStruct(zcu: *Zcu, decl_index: Decl.Index, namespace_index: Namespace.Index, file: *File) Allocator.Error!InternPool.Index { | 3349 | fn getFileRootStruct(zcu: *Zcu, decl_index: Decl.Index, namespace_index: Namespace.Index, file: *File) Allocator.Error!InternPool.Index { |
| ... | @@ -3383,9 +3415,13 @@ fn getFileRootStruct(zcu: *Zcu, decl_index: Decl.Index, namespace_index: Namespa | ... | @@ -3383,9 +3415,13 @@ fn getFileRootStruct(zcu: *Zcu, decl_index: Decl.Index, namespace_index: Namespa |
| 3383 | /// reconstructed at a new InternPool index. Otherwise, the namespace is just | 3415 | /// reconstructed at a new InternPool index. Otherwise, the namespace is just |
| 3384 | /// re-analyzed. Returns whether the decl's tyval was invalidated. | 3416 | /// re-analyzed. Returns whether the decl's tyval was invalidated. |
| 3385 | fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { | 3417 | fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { |
| 3386 | assert(file.root_decl != .none); | 3418 | const decl = zcu.declPtr(file.root_decl.unwrap().?); |
| 3387 | | 3419 | |
| 3388 | const decl = zcu.declPtr(file.root_decl); | 3420 | log.debug("semaFileUpdate mod={s} sub_file_path={s} type_outdated={}", .{ |
| | 3421 | file.mod.fully_qualified_name, |
| | 3422 | file.sub_file_path, |
| | 3423 | type_outdated, |
| | 3424 | }); |
| 3389 | | 3425 | |
| 3390 | if (file.status != .success_zir) { | 3426 | if (file.status != .success_zir) { |
| 3391 | if (decl.analysis == .file_failure) { | 3427 | if (decl.analysis == .file_failure) { |
| ... | @@ -3398,7 +3434,7 @@ fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { | ... | @@ -3398,7 +3434,7 @@ fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { |
| 3398 | | 3434 | |
| 3399 | if (decl.analysis == .file_failure) { | 3435 | if (decl.analysis == .file_failure) { |
| 3400 | // No struct type currently exists. Create one! | 3436 | // No struct type currently exists. Create one! |
| 3401 | _ = try zcu.getFileRootStruct(file.root_decl, decl.src_namespace, file); | 3437 | _ = try zcu.getFileRootStruct(file.root_decl.unwrap().?, decl.src_namespace, file); |
| 3402 | return true; | 3438 | return true; |
| 3403 | } | 3439 | } |
| 3404 | | 3440 | |
| ... | @@ -3407,9 +3443,10 @@ fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { | ... | @@ -3407,9 +3443,10 @@ fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { |
| 3407 | | 3443 | |
| 3408 | if (type_outdated) { | 3444 | if (type_outdated) { |
| 3409 | // Invalidate the existing type, reusing the decl and namespace. | 3445 | // Invalidate the existing type, reusing the decl and namespace. |
| 3410 | try zcu.intern_pool.remove(decl.val.toIntern()); | 3446 | zcu.intern_pool.removeDependenciesForDepender(zcu.gpa, InternPool.Depender.wrap(.{ .decl = file.root_decl.unwrap().? })); |
| | 3447 | zcu.intern_pool.remove(decl.val.toIntern()); |
| 3411 | decl.val = undefined; | 3448 | decl.val = undefined; |
| 3412 | _ = try zcu.getFileRootStruct(file.root_decl, decl.src_namespace, file); | 3449 | _ = try zcu.getFileRootStruct(file.root_decl.unwrap().?, decl.src_namespace, file); |
| 3413 | return true; | 3450 | return true; |
| 3414 | } | 3451 | } |
| 3415 | | 3452 | |
| ... | @@ -3420,7 +3457,7 @@ fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { | ... | @@ -3420,7 +3457,7 @@ fn semaFileUpdate(zcu: *Zcu, file: *File, type_outdated: bool) SemaError!bool { |
| 3420 | const small: Zir.Inst.StructDecl.Small = @bitCast(extended.small); | 3457 | const small: Zir.Inst.StructDecl.Small = @bitCast(extended.small); |
| 3421 | | 3458 | |
| 3422 | var extra_index: usize = extended.operand + @typeInfo(Zir.Inst.StructDecl).Struct.fields.len; | 3459 | var extra_index: usize = extended.operand + @typeInfo(Zir.Inst.StructDecl).Struct.fields.len; |
| 3423 | extra_index += @intFromEnum(small.has_fields_len); | 3460 | extra_index += @intFromBool(small.has_fields_len); |
| 3424 | const decls_len = if (small.has_decls_len) blk: { | 3461 | const decls_len = if (small.has_decls_len) blk: { |
| 3425 | const decls_len = file.zir.extra[extra_index]; | 3462 | const decls_len = file.zir.extra[extra_index]; |
| 3426 | extra_index += 1; | 3463 | extra_index += 1; |
| ... | @@ -3530,11 +3567,13 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !SemaDeclResult { | ... | @@ -3530,11 +3567,13 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !SemaDeclResult { |
| 3530 | | 3567 | |
| 3531 | assert(!mod.declIsRoot(decl_index)); | 3568 | assert(!mod.declIsRoot(decl_index)); |
| 3532 | | 3569 | |
| 3533 | if (decl.owns_tv) { | 3570 | if (decl.zir_decl_index == .none and decl.owns_tv) { |
| 3534 | // We are re-analyzing an owner Decl (for a function or a namespace type). | 3571 | // We are re-analyzing an anonymous owner Decl (for a function or a namespace type). |
| 3535 | @panic("TODO: update owner Decl"); | 3572 | return mod.semaAnonOwnerDecl(decl_index); |
| 3536 | } | 3573 | } |
| 3537 | | 3574 | |
| | 3575 | log.debug("semaDecl '{d}'", .{@intFromEnum(decl_index)}); |
| | 3576 | |
| 3538 | const decl_inst = decl.zir_decl_index.unwrap().?.resolve(ip); | 3577 | const decl_inst = decl.zir_decl_index.unwrap().?.resolve(ip); |
| 3539 | | 3578 | |
| 3540 | const gpa = mod.gpa; | 3579 | const gpa = mod.gpa; |
| ... | @@ -3827,6 +3866,42 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !SemaDeclResult { | ... | @@ -3827,6 +3866,42 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !SemaDeclResult { |
| 3827 | return result; | 3866 | return result; |
| 3828 | } | 3867 | } |
| 3829 | | 3868 | |
| | 3869 | fn semaAnonOwnerDecl(zcu: *Zcu, decl_index: Decl.Index) !SemaDeclResult { |
| | 3870 | const decl = zcu.declPtr(decl_index); |
| | 3871 | |
| | 3872 | assert(decl.has_tv); |
| | 3873 | assert(decl.owns_tv); |
| | 3874 | |
| | 3875 | log.debug("semaAnonOwnerDecl '{d}'", .{@intFromEnum(decl_index)}); |
| | 3876 | |
| | 3877 | switch (decl.ty.zigTypeTag(zcu)) { |
| | 3878 | .Fn => @panic("TODO: update fn instance"), |
| | 3879 | .Type => {}, |
| | 3880 | else => unreachable, |
| | 3881 | } |
| | 3882 | |
| | 3883 | // We are the owner Decl of a type, and we were marked as outdated. That means the *structure* |
| | 3884 | // of this type changed; not just its namespace. Therefore, we need a new InternPool index. |
| | 3885 | // |
| | 3886 | // However, as soon as we make that, the context that created us will require re-analysis anyway |
| | 3887 | // (as it depends on this Decl's value), meaning the `struct_decl` (or equivalent) instruction |
| | 3888 | // will be analyzed again. Since Sema already needs to be able to reconstruct types like this, |
| | 3889 | // why should we bother implementing it here too when the Sema logic will be hit right after? |
| | 3890 | // |
| | 3891 | // So instead, let's just mark this Decl as failed - so that any remaining Decls which genuinely |
| | 3892 | // reference it (via `@This`) end up silently erroring too - and we'll let Sema make a new type |
| | 3893 | // with a new Decl. |
| | 3894 | // |
| | 3895 | // Yes, this does mean that any type owner Decl has a constant value for its entire lifetime. |
| | 3896 | zcu.intern_pool.removeDependenciesForDepender(zcu.gpa, InternPool.Depender.wrap(.{ .decl = decl_index })); |
| | 3897 | zcu.intern_pool.remove(decl.val.toIntern()); |
| | 3898 | decl.analysis = .dependency_failure; |
| | 3899 | return .{ |
| | 3900 | .invalidate_decl_val = true, |
| | 3901 | .invalidate_decl_ref = true, |
| | 3902 | }; |
| | 3903 | } |
| | 3904 | |
| 3830 | pub const ImportFileResult = struct { | 3905 | pub const ImportFileResult = struct { |
| 3831 | file: *File, | 3906 | file: *File, |
| 3832 | is_new: bool, | 3907 | is_new: bool, |
| ... | @@ -4152,7 +4227,7 @@ pub fn scanNamespace( | ... | @@ -4152,7 +4227,7 @@ pub fn scanNamespace( |
| 4152 | var existing_by_inst: std.AutoHashMapUnmanaged(InternPool.TrackedInst.Index, Decl.Index) = .{}; | 4227 | var existing_by_inst: std.AutoHashMapUnmanaged(InternPool.TrackedInst.Index, Decl.Index) = .{}; |
| 4153 | defer existing_by_inst.deinit(gpa); | 4228 | defer existing_by_inst.deinit(gpa); |
| 4154 | | 4229 | |
| 4155 | try existing_by_inst.ensureTotalCapacity(namespace.decls.count()); | 4230 | try existing_by_inst.ensureTotalCapacity(gpa, @intCast(namespace.decls.count())); |
| 4156 | | 4231 | |
| 4157 | for (namespace.decls.keys()) |decl_index| { | 4232 | for (namespace.decls.keys()) |decl_index| { |
| 4158 | const decl = zcu.declPtr(decl_index); | 4233 | const decl = zcu.declPtr(decl_index); |
| ... | @@ -4357,7 +4432,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_inst: Zir.Inst.Index) Allocator.Error!void | ... | @@ -4357,7 +4432,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_inst: Zir.Inst.Index) Allocator.Error!void |
| 4357 | .anon => unreachable, | 4432 | .anon => unreachable, |
| 4358 | .@"comptime" => true, | 4433 | .@"comptime" => true, |
| 4359 | .@"usingnamespace" => a: { | 4434 | .@"usingnamespace" => a: { |
| 4360 | namespace.usingnamespace_set.putNoClobber(decl_index, declaration.flags.is_pub); | 4435 | namespace.usingnamespace_set.putAssumeCapacityNoClobber(decl_index, declaration.flags.is_pub); |
| 4361 | break :a true; | 4436 | break :a true; |
| 4362 | }, | 4437 | }, |
| 4363 | .named => false, | 4438 | .named => false, |
| ... | @@ -4533,6 +4608,11 @@ pub fn analyzeFnBody(mod: *Module, func_index: InternPool.Index, arena: Allocato | ... | @@ -4533,6 +4608,11 @@ pub fn analyzeFnBody(mod: *Module, func_index: InternPool.Index, arena: Allocato |
| 4533 | }; | 4608 | }; |
| 4534 | defer sema.deinit(); | 4609 | defer sema.deinit(); |
| 4535 | | 4610 | |
| | 4611 | // Every runtime function has a dependency on the source of the Decl it originates from. |
| | 4612 | // It also depends on the value of its owner Decl. |
| | 4613 | try sema.declareDependency(.{ .src_hash = decl.zir_decl_index.unwrap().? }); |
| | 4614 | try sema.declareDependency(.{ .decl_val = decl_index }); |
| | 4615 | |
| 4536 | if (func.analysis(ip).inferred_error_set) { | 4616 | if (func.analysis(ip).inferred_error_set) { |
| 4537 | const ies = try arena.create(Sema.InferredErrorSet); | 4617 | const ies = try arena.create(Sema.InferredErrorSet); |
| 4538 | ies.* = .{ .func = func_index }; | 4618 | ies.* = .{ .func = func_index }; |