| ... | @@ -17769,11 +17769,12 @@ fn zirBuiltinSrc( | ... | @@ -17769,11 +17769,12 @@ fn zirBuiltinSrc( |
| 17769 | defer tracy.end(); | 17769 | defer tracy.end(); |
| 17770 | | 17770 | |
| 17771 | const pt = sema.pt; | 17771 | const pt = sema.pt; |
| 17772 | const mod = pt.zcu; | 17772 | const zcu = pt.zcu; |
| 17773 | const extra = sema.code.extraData(Zir.Inst.Src, extended.operand).data; | 17773 | const extra = sema.code.extraData(Zir.Inst.Src, extended.operand).data; |
| 17774 | const fn_owner_decl = mod.funcOwnerDeclPtr(sema.func_index); | 17774 | const fn_owner_decl = zcu.funcOwnerDeclPtr(sema.func_index); |
| 17775 | const ip = &mod.intern_pool; | 17775 | const ip = &zcu.intern_pool; |
| 17776 | const gpa = sema.gpa; | 17776 | const gpa = sema.gpa; |
| | 17777 | const file_scope = fn_owner_decl.getFileScope(zcu); |
| 17777 | | 17778 | |
| 17778 | const func_name_val = v: { | 17779 | const func_name_val = v: { |
| 17779 | const func_name_len = fn_owner_decl.name.length(ip); | 17780 | const func_name_len = fn_owner_decl.name.length(ip); |
| ... | @@ -17799,8 +17800,34 @@ fn zirBuiltinSrc( | ... | @@ -17799,8 +17800,34 @@ fn zirBuiltinSrc( |
| 17799 | } }); | 17800 | } }); |
| 17800 | }; | 17801 | }; |
| 17801 | | 17802 | |
| | 17803 | const module_name_val = v: { |
| | 17804 | const module_name = file_scope.mod.fully_qualified_name; |
| | 17805 | const array_ty = try pt.intern(.{ .array_type = .{ |
| | 17806 | .len = module_name.len, |
| | 17807 | .sentinel = .zero_u8, |
| | 17808 | .child = .u8_type, |
| | 17809 | } }); |
| | 17810 | break :v try pt.intern(.{ .slice = .{ |
| | 17811 | .ty = .slice_const_u8_sentinel_0_type, |
| | 17812 | .ptr = try pt.intern(.{ .ptr = .{ |
| | 17813 | .ty = .manyptr_const_u8_sentinel_0_type, |
| | 17814 | .base_addr = .{ .anon_decl = .{ |
| | 17815 | .orig_ty = .slice_const_u8_sentinel_0_type, |
| | 17816 | .val = try pt.intern(.{ .aggregate = .{ |
| | 17817 | .ty = array_ty, |
| | 17818 | .storage = .{ |
| | 17819 | .bytes = try ip.getOrPutString(gpa, pt.tid, module_name, .maybe_embedded_nulls), |
| | 17820 | }, |
| | 17821 | } }), |
| | 17822 | } }, |
| | 17823 | .byte_offset = 0, |
| | 17824 | } }), |
| | 17825 | .len = (try pt.intValue(Type.usize, module_name.len)).toIntern(), |
| | 17826 | } }); |
| | 17827 | }; |
| | 17828 | |
| 17802 | const file_name_val = v: { | 17829 | const file_name_val = v: { |
| 17803 | const file_name = fn_owner_decl.getFileScope(mod).sub_file_path; | 17830 | const file_name = file_scope.sub_file_path; |
| 17804 | const array_ty = try pt.intern(.{ .array_type = .{ | 17831 | const array_ty = try pt.intern(.{ .array_type = .{ |
| 17805 | .len = file_name.len, | 17832 | .len = file_name.len, |
| 17806 | .sentinel = .zero_u8, | 17833 | .sentinel = .zero_u8, |
| ... | @@ -17827,6 +17854,8 @@ fn zirBuiltinSrc( | ... | @@ -17827,6 +17854,8 @@ fn zirBuiltinSrc( |
| 17827 | | 17854 | |
| 17828 | const src_loc_ty = try pt.getBuiltinType("SourceLocation"); | 17855 | const src_loc_ty = try pt.getBuiltinType("SourceLocation"); |
| 17829 | const fields = .{ | 17856 | const fields = .{ |
| | 17857 | // module: [:0]const u8, |
| | 17858 | module_name_val, |
| 17830 | // file: [:0]const u8, | 17859 | // file: [:0]const u8, |
| 17831 | file_name_val, | 17860 | file_name_val, |
| 17832 | // fn_name: [:0]const u8, | 17861 | // fn_name: [:0]const u8, |