| ... | @@ -26660,13 +26660,12 @@ fn prepareSimplePanic(sema: *Sema, block: *Block) !void { | ... | @@ -26660,13 +26660,12 @@ fn prepareSimplePanic(sema: *Sema, block: *Block) !void { |
| 26660 | // decl_index may be an alias; we must find the decl that actually | 26660 | // decl_index may be an alias; we must find the decl that actually |
| 26661 | // owns the function. | 26661 | // owns the function. |
| 26662 | try sema.ensureDeclAnalyzed(decl_index); | 26662 | try sema.ensureDeclAnalyzed(decl_index); |
| 26663 | const tv = try mod.declPtr(decl_index).typedValue(mod); | 26663 | const fn_val = try mod.declPtr(decl_index).valueOrFail(); |
| 26664 | try sema.declareDependency(.{ .decl_val = decl_index }); | 26664 | try sema.declareDependency(.{ .decl_val = decl_index }); |
| 26665 | assert(tv.ty.zigTypeTag(mod) == .Fn); | 26665 | assert(fn_val.typeOf(mod).zigTypeTag(mod) == .Fn); |
| 26666 | assert(try sema.fnHasRuntimeBits(tv.ty)); | 26666 | assert(try sema.fnHasRuntimeBits(fn_val.typeOf(mod))); |
| 26667 | const func_index = tv.val.toIntern(); | 26667 | try mod.ensureFuncBodyAnalysisQueued(fn_val.toIntern()); |
| 26668 | try mod.ensureFuncBodyAnalysisQueued(func_index); | 26668 | mod.panic_func_index = fn_val.toIntern(); |
| 26669 | mod.panic_func_index = func_index; | | |
| 26670 | } | 26669 | } |
| 26671 | | 26670 | |
| 26672 | if (mod.null_stack_trace == .none) { | 26671 | if (mod.null_stack_trace == .none) { |
| ... | @@ -32449,8 +32448,8 @@ fn analyzeDeclRefInner(sema: *Sema, decl_index: InternPool.DeclIndex, analyze_fn | ... | @@ -32449,8 +32448,8 @@ fn analyzeDeclRefInner(sema: *Sema, decl_index: InternPool.DeclIndex, analyze_fn |
| 32449 | const mod = sema.mod; | 32448 | const mod = sema.mod; |
| 32450 | try sema.ensureDeclAnalyzed(decl_index); | 32449 | try sema.ensureDeclAnalyzed(decl_index); |
| 32451 | | 32450 | |
| 32452 | const decl_tv = try mod.declPtr(decl_index).typedValue(mod); | 32451 | const decl_val = try mod.declPtr(decl_index).valueOrFail(); |
| 32453 | const owner_decl = mod.declPtr(switch (mod.intern_pool.indexToKey(decl_tv.val.toIntern())) { | 32452 | const owner_decl = mod.declPtr(switch (mod.intern_pool.indexToKey(decl_val.toIntern())) { |
| 32454 | .variable => |variable| variable.decl, | 32453 | .variable => |variable| variable.decl, |
| 32455 | .extern_func => |extern_func| extern_func.decl, | 32454 | .extern_func => |extern_func| extern_func.decl, |
| 32456 | .func => |func| func.owner_decl, | 32455 | .func => |func| func.owner_decl, |
| ... | @@ -32459,10 +32458,10 @@ fn analyzeDeclRefInner(sema: *Sema, decl_index: InternPool.DeclIndex, analyze_fn | ... | @@ -32459,10 +32458,10 @@ fn analyzeDeclRefInner(sema: *Sema, decl_index: InternPool.DeclIndex, analyze_fn |
| 32459 | // TODO: if this is a `decl_ref` of a non-variable decl, only depend on decl type | 32458 | // TODO: if this is a `decl_ref` of a non-variable decl, only depend on decl type |
| 32460 | try sema.declareDependency(.{ .decl_val = decl_index }); | 32459 | try sema.declareDependency(.{ .decl_val = decl_index }); |
| 32461 | const ptr_ty = try sema.ptrType(.{ | 32460 | const ptr_ty = try sema.ptrType(.{ |
| 32462 | .child = decl_tv.ty.toIntern(), | 32461 | .child = decl_val.typeOf(mod).toIntern(), |
| 32463 | .flags = .{ | 32462 | .flags = .{ |
| 32464 | .alignment = owner_decl.alignment, | 32463 | .alignment = owner_decl.alignment, |
| 32465 | .is_const = if (decl_tv.val.getVariable(mod)) |variable| variable.is_const else true, | 32464 | .is_const = if (decl_val.getVariable(mod)) |variable| variable.is_const else true, |
| 32466 | .address_space = owner_decl.@"addrspace", | 32465 | .address_space = owner_decl.@"addrspace", |
| 32467 | }, | 32466 | }, |
| 32468 | }); | 32467 | }); |
| ... | @@ -32478,12 +32477,10 @@ fn analyzeDeclRefInner(sema: *Sema, decl_index: InternPool.DeclIndex, analyze_fn | ... | @@ -32478,12 +32477,10 @@ fn analyzeDeclRefInner(sema: *Sema, decl_index: InternPool.DeclIndex, analyze_fn |
| 32478 | fn maybeQueueFuncBodyAnalysis(sema: *Sema, decl_index: InternPool.DeclIndex) !void { | 32477 | fn maybeQueueFuncBodyAnalysis(sema: *Sema, decl_index: InternPool.DeclIndex) !void { |
| 32479 | const mod = sema.mod; | 32478 | const mod = sema.mod; |
| 32480 | const decl = mod.declPtr(decl_index); | 32479 | const decl = mod.declPtr(decl_index); |
| 32481 | const tv = try decl.typedValue(mod); | 32480 | const decl_val = try decl.valueOrFail(); |
| 32482 | if (tv.ty.zigTypeTag(mod) != .Fn) return; | 32481 | if (!mod.intern_pool.isFuncBody(decl_val.toIntern())) return; |
| 32483 | if (!try sema.fnHasRuntimeBits(tv.ty)) return; | 32482 | if (!try sema.fnHasRuntimeBits(decl_val.typeOf(mod))) return; |
| 32484 | const func_index = tv.val.toIntern(); | 32483 | try mod.ensureFuncBodyAnalysisQueued(decl_val.toIntern()); |
| 32485 | if (!mod.intern_pool.isFuncBody(func_index)) return; // undef or extern function | | |
| 32486 | try mod.ensureFuncBodyAnalysisQueued(func_index); | | |
| 32487 | } | 32484 | } |
| 32488 | | 32485 | |
| 32489 | fn analyzeRef( | 32486 | fn analyzeRef( |
| ... | @@ -39049,7 +39046,6 @@ fn sliceToIpString( | ... | @@ -39049,7 +39046,6 @@ fn sliceToIpString( |
| 39049 | reason: NeededComptimeReason, | 39046 | reason: NeededComptimeReason, |
| 39050 | ) CompileError!InternPool.NullTerminatedString { | 39047 | ) CompileError!InternPool.NullTerminatedString { |
| 39051 | const zcu = sema.mod; | 39048 | const zcu = sema.mod; |
| 39052 | const ip = &zcu.intern_pool; | | |
| 39053 | const slice_ty = slice_val.typeOf(zcu); | 39049 | const slice_ty = slice_val.typeOf(zcu); |
| 39054 | assert(slice_ty.isSlice(zcu)); | 39050 | assert(slice_ty.isSlice(zcu)); |
| 39055 | assert(slice_ty.childType(zcu).toIntern() == .u8_type); | 39051 | assert(slice_ty.childType(zcu).toIntern() == .u8_type); |