| ... | @@ -6457,15 +6457,7 @@ fn zirExport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void | ... | @@ -6457,15 +6457,7 @@ fn zirExport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void |
| 6457 | if (ptr_info.byte_offset != 0) { | 6457 | if (ptr_info.byte_offset != 0) { |
| 6458 | return sema.fail(block, ptr_src, "TODO: export pointer in middle of value", .{}); | 6458 | return sema.fail(block, ptr_src, "TODO: export pointer in middle of value", .{}); |
| 6459 | } | 6459 | } |
| 6460 | try sema.ensureNavResolved(src, nav); | 6460 | try sema.analyzeExport(block, src, options, nav); |
| 6461 | // Make sure to export the owner Nav if applicable. | | |
| 6462 | const exported_nav = switch (ip.indexToKey(ip.getNav(nav).status.resolved.val)) { | | |
| 6463 | .variable => |v| v.owner_nav, | | |
| 6464 | .@"extern" => |e| e.owner_nav, | | |
| 6465 | .func => |f| f.owner_nav, | | |
| 6466 | else => nav, | | |
| 6467 | }; | | |
| 6468 | try sema.analyzeExport(block, src, options, exported_nav); | | |
| 6469 | }, | 6461 | }, |
| 6470 | } | 6462 | } |
| 6471 | } | 6463 | } |
| ... | @@ -6475,7 +6467,7 @@ pub fn analyzeExport( | ... | @@ -6475,7 +6467,7 @@ pub fn analyzeExport( |
| 6475 | block: *Block, | 6467 | block: *Block, |
| 6476 | src: LazySrcLoc, | 6468 | src: LazySrcLoc, |
| 6477 | options: Zcu.Export.Options, | 6469 | options: Zcu.Export.Options, |
| 6478 | exported_nav_index: InternPool.Nav.Index, | 6470 | orig_nav_index: InternPool.Nav.Index, |
| 6479 | ) !void { | 6471 | ) !void { |
| 6480 | const gpa = sema.gpa; | 6472 | const gpa = sema.gpa; |
| 6481 | const pt = sema.pt; | 6473 | const pt = sema.pt; |
| ... | @@ -6485,7 +6477,15 @@ pub fn analyzeExport( | ... | @@ -6485,7 +6477,15 @@ pub fn analyzeExport( |
| 6485 | if (options.linkage == .internal) | 6477 | if (options.linkage == .internal) |
| 6486 | return; | 6478 | return; |
| 6487 | | 6479 | |
| 6488 | try sema.ensureNavResolved(src, exported_nav_index); | 6480 | try sema.ensureNavResolved(src, orig_nav_index); |
| | 6481 | |
| | 6482 | const exported_nav_index = switch (ip.indexToKey(ip.getNav(orig_nav_index).status.resolved.val)) { |
| | 6483 | .variable => |v| v.owner_nav, |
| | 6484 | .@"extern" => |e| e.owner_nav, |
| | 6485 | .func => |f| f.owner_nav, |
| | 6486 | else => orig_nav_index, |
| | 6487 | }; |
| | 6488 | |
| 6489 | const exported_nav = ip.getNav(exported_nav_index); | 6489 | const exported_nav = ip.getNav(exported_nav_index); |
| 6490 | const export_ty = Type.fromInterned(exported_nav.typeOf(ip)); | 6490 | const export_ty = Type.fromInterned(exported_nav.typeOf(ip)); |
| 6491 | | 6491 | |