| ... | ... | @@ -2662,7 +2662,6 @@ fn initWipNavInner( |
| 2662 | 2662 | try wip_nav.strp(@"extern".name.toSlice(ip)); |
| 2663 | 2663 | try wip_nav.refType(.fromInterned(if (maybe_func_type) |func_type| func_type.return_type else @"extern".ty)); |
| 2664 | 2664 | if (maybe_func_type) |func_type| { |
| 2665 | | try wip_nav.infoAddrSym(sym_index, 0); |
| 2666 | 2665 | try diw.writeByte(@intFromBool(Type.fromInterned(func_type.return_type).isNoReturn(zcu))); |
| 2667 | 2666 | if (func_type.param_types.len > 0 or func_type.is_var_args) { |
| 2668 | 2667 | for (func_type.param_types.get(ip)) |param_type| { |
| ... | ... | @@ -2672,7 +2671,7 @@ fn initWipNavInner( |
| 2672 | 2671 | if (func_type.is_var_args) try wip_nav.abbrevCode(.is_var_args); |
| 2673 | 2672 | try diw.writeUleb128(@backingInt(AbbrevCode.null)); |
| 2674 | 2673 | } |
| 2675 | | } else try wip_nav.infoExprLoc(.{ .addr_reloc = sym_index }); |
| 2674 | } |
| 2676 | 2675 | }, |
| 2677 | 2676 | .syntax => switch (ip.isFunctionType(@"extern".ty)) { |
| 2678 | 2677 | false => continue :nav_val .{ .undef = @"extern".ty }, |
| ... | ... | @@ -2690,7 +2689,6 @@ fn initWipNavInner( |
| 2690 | 2689 | }, &nav, inst_info.file, &decl); |
| 2691 | 2690 | try wip_nav.strp(@"extern".name.toSlice(ip)); |
| 2692 | 2691 | try wip_nav.refType(.fromInterned(func_type.return_type)); |
| 2693 | | try wip_nav.infoAddrSym(sym_index, 0); |
| 2694 | 2692 | try diw.writeByte(@intFromBool(Type.fromInterned(func_type.return_type).isNoReturn(zcu))); |
| 2695 | 2693 | if (func_type.param_types.len > 0 or func_type.is_var_args) { |
| 2696 | 2694 | for (func_type.param_types.get(ip)) |param_type| { |
| ... | ... | @@ -2817,13 +2815,19 @@ fn initWipNavInner( |
| 2817 | 2815 | else => { |
| 2818 | 2816 | const diw = &wip_nav.debug_info.writer; |
| 2819 | 2817 | try wip_nav.declCommon(.{ |
| 2820 | | .decl = .decl_var, |
| 2818 | .decl = switch (decl.linkage) { |
| 2819 | .@"extern" => .decl_extern_var, |
| 2820 | else => .decl_var, |
| 2821 | }, |
| 2821 | 2822 | .decl_specification = switch (decl.kind) { |
| 2822 | 2823 | .unnamed_test, .@"test", .decltest, .@"comptime" => unreachable, |
| 2823 | 2824 | .@"const" => .decl_specification_const, |
| 2824 | 2825 | .@"var" => .decl_specification_var, |
| 2825 | 2826 | }, |
| 2826 | | .decl_instance = .decl_instance_var, |
| 2827 | .decl_instance = switch (decl.linkage) { |
| 2828 | .@"extern" => .decl_instance_extern_var, |
| 2829 | else => .decl_instance_var, |
| 2830 | }, |
| 2827 | 2831 | }, &nav, inst_info.file, &decl); |
| 2828 | 2832 | try wip_nav.strp(switch (decl.linkage) { |
| 2829 | 2833 | .normal => nav.fqn, |
| ... | ... | @@ -2842,20 +2846,24 @@ fn initWipNavInner( |
| 2842 | 2846 | .unnamed_test, .@"test", .decltest, .@"comptime" => unreachable, |
| 2843 | 2847 | .@"const" => { |
| 2844 | 2848 | const const_ty_reloc_index = try wip_nav.refForward(); |
| 2845 | | try wip_nav.infoExprLoc(loc); |
| 2849 | if (decl.linkage != .@"extern") try wip_nav.infoExprLoc(loc); |
| 2846 | 2850 | try diw.writeUleb128(nav.resolved.?.@"align".toByteUnits() orelse |
| 2847 | 2851 | ty.abiAlignment(zcu).toByteUnits().?); |
| 2848 | | try diw.writeByte(@intFromBool(decl.linkage != .normal)); |
| 2852 | if (decl.linkage != .@"extern") { |
| 2853 | try diw.writeByte(@intFromBool(decl.linkage != .normal)); |
| 2854 | } |
| 2849 | 2855 | wip_nav.finishForward(const_ty_reloc_index); |
| 2850 | 2856 | try wip_nav.abbrevCode(.is_const); |
| 2851 | 2857 | try wip_nav.refType(ty); |
| 2852 | 2858 | }, |
| 2853 | 2859 | .@"var" => { |
| 2854 | 2860 | try wip_nav.refType(ty); |
| 2855 | | try wip_nav.infoExprLoc(loc); |
| 2861 | if (decl.linkage != .@"extern") try wip_nav.infoExprLoc(loc); |
| 2856 | 2862 | try diw.writeUleb128(nav.resolved.?.@"align".toByteUnits() orelse |
| 2857 | 2863 | ty.abiAlignment(zcu).toByteUnits().?); |
| 2858 | | try diw.writeByte(@intFromBool(decl.linkage != .normal)); |
| 2864 | if (decl.linkage != .@"extern") { |
| 2865 | try diw.writeByte(@intFromBool(decl.linkage != .normal)); |
| 2866 | } |
| 2859 | 2867 | }, |
| 2860 | 2868 | } |
| 2861 | 2869 | }, |
| ... | ... | @@ -5138,6 +5146,7 @@ const AbbrevCode = enum { |
| 5138 | 5146 | decl_union, |
| 5139 | 5147 | decl_packed_union, |
| 5140 | 5148 | decl_var, |
| 5149 | decl_extern_var, |
| 5141 | 5150 | decl_const, |
| 5142 | 5151 | decl_const_runtime_bits, |
| 5143 | 5152 | decl_const_comptime_state, |
| ... | ... | @@ -5160,6 +5169,7 @@ const AbbrevCode = enum { |
| 5160 | 5169 | decl_instance_union, |
| 5161 | 5170 | decl_instance_packed_union, |
| 5162 | 5171 | decl_instance_var, |
| 5172 | decl_instance_extern_var, |
| 5163 | 5173 | decl_instance_const, |
| 5164 | 5174 | decl_instance_const_runtime_bits, |
| 5165 | 5175 | decl_instance_const_comptime_state, |
| ... | ... | @@ -5360,6 +5370,15 @@ const AbbrevCode = enum { |
| 5360 | 5370 | .{ .external, .flag }, |
| 5361 | 5371 | }, |
| 5362 | 5372 | }, |
| 5373 | .decl_extern_var = .{ |
| 5374 | .tag = .variable, |
| 5375 | .attrs = decl_abbrev_common_attrs ++ .{ |
| 5376 | .{ .linkage_name, .strp }, |
| 5377 | .{ .type, .ref_addr }, |
| 5378 | .{ .alignment, .udata }, |
| 5379 | .{ .external, .flag_present }, |
| 5380 | }, |
| 5381 | }, |
| 5363 | 5382 | .decl_const = .{ |
| 5364 | 5383 | .tag = .constant, |
| 5365 | 5384 | .attrs = decl_abbrev_common_attrs ++ .{ |
| ... | ... | @@ -5443,7 +5462,6 @@ const AbbrevCode = enum { |
| 5443 | 5462 | .attrs = decl_abbrev_common_attrs ++ .{ |
| 5444 | 5463 | .{ .linkage_name, .strp }, |
| 5445 | 5464 | .{ .type, .ref_addr }, |
| 5446 | | .{ .low_pc, .addr }, |
| 5447 | 5465 | .{ .external, .flag_present }, |
| 5448 | 5466 | .{ .noreturn, .flag }, |
| 5449 | 5467 | }, |
| ... | ... | @@ -5454,7 +5472,6 @@ const AbbrevCode = enum { |
| 5454 | 5472 | .attrs = decl_abbrev_common_attrs ++ .{ |
| 5455 | 5473 | .{ .linkage_name, .strp }, |
| 5456 | 5474 | .{ .type, .ref_addr }, |
| 5457 | | .{ .low_pc, .addr }, |
| 5458 | 5475 | .{ .external, .flag_present }, |
| 5459 | 5476 | .{ .noreturn, .flag }, |
| 5460 | 5477 | }, |
| ... | ... | @@ -5536,6 +5553,15 @@ const AbbrevCode = enum { |
| 5536 | 5553 | .{ .external, .flag }, |
| 5537 | 5554 | }, |
| 5538 | 5555 | }, |
| 5556 | .decl_instance_extern_var = .{ |
| 5557 | .tag = .variable, |
| 5558 | .attrs = decl_instance_abbrev_common_attrs ++ .{ |
| 5559 | .{ .linkage_name, .strp }, |
| 5560 | .{ .location, .exprloc }, |
| 5561 | .{ .alignment, .udata }, |
| 5562 | .{ .external, .flag_present }, |
| 5563 | }, |
| 5564 | }, |
| 5539 | 5565 | .decl_instance_const = .{ |
| 5540 | 5566 | .tag = .constant, |
| 5541 | 5567 | .attrs = decl_instance_abbrev_common_attrs ++ .{ |
| ... | ... | @@ -5619,7 +5645,6 @@ const AbbrevCode = enum { |
| 5619 | 5645 | .attrs = decl_instance_abbrev_common_attrs ++ .{ |
| 5620 | 5646 | .{ .linkage_name, .strp }, |
| 5621 | 5647 | .{ .type, .ref_addr }, |
| 5622 | | .{ .low_pc, .addr }, |
| 5623 | 5648 | .{ .external, .flag_present }, |
| 5624 | 5649 | .{ .noreturn, .flag }, |
| 5625 | 5650 | }, |
| ... | ... | @@ -5630,7 +5655,6 @@ const AbbrevCode = enum { |
| 5630 | 5655 | .attrs = decl_instance_abbrev_common_attrs ++ .{ |
| 5631 | 5656 | .{ .linkage_name, .strp }, |
| 5632 | 5657 | .{ .type, .ref_addr }, |
| 5633 | | .{ .low_pc, .addr }, |
| 5634 | 5658 | .{ .external, .flag_present }, |
| 5635 | 5659 | .{ .noreturn, .flag }, |
| 5636 | 5660 | }, |
| ... | ... | @@ -6048,7 +6072,6 @@ const AbbrevCode = enum { |
| 6048 | 6072 | .{ .ZIG_parent, .ref_addr }, |
| 6049 | 6073 | .{ .linkage_name, .strp }, |
| 6050 | 6074 | .{ .type, .ref_addr }, |
| 6051 | | .{ .low_pc, .addr }, |
| 6052 | 6075 | .{ .external, .flag_present }, |
| 6053 | 6076 | .{ .noreturn, .flag }, |
| 6054 | 6077 | }, |
| ... | ... | @@ -6060,7 +6083,6 @@ const AbbrevCode = enum { |
| 6060 | 6083 | .{ .ZIG_parent, .ref_addr }, |
| 6061 | 6084 | .{ .linkage_name, .strp }, |
| 6062 | 6085 | .{ .type, .ref_addr }, |
| 6063 | | .{ .low_pc, .addr }, |
| 6064 | 6086 | .{ .external, .flag_present }, |
| 6065 | 6087 | .{ .noreturn, .flag }, |
| 6066 | 6088 | }, |
| ... | ... | @@ -6071,7 +6093,6 @@ const AbbrevCode = enum { |
| 6071 | 6093 | .{ .ZIG_parent, .ref_addr }, |
| 6072 | 6094 | .{ .linkage_name, .strp }, |
| 6073 | 6095 | .{ .type, .ref_addr }, |
| 6074 | | .{ .location, .exprloc }, |
| 6075 | 6096 | .{ .external, .flag_present }, |
| 6076 | 6097 | }, |
| 6077 | 6098 | }, |