mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Dwarf: preserve deduped struct navs
Previously, if multiple navs owned the same type due to being the same zir node and having the same captures, they would overwrite each other. Now, the navs codegenned later emit a decl alias to the first one.
This commit is contained in:
parent
d12c0bf909
commit
74ba5762ec
@ -2632,7 +2632,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
|
||||
|
||||
const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern());
|
||||
if (type_gop.found_existing) {
|
||||
dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).clear();
|
||||
if (dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).len > 0) break :tag .decl_alias;
|
||||
nav_gop.value_ptr.* = type_gop.value_ptr.*;
|
||||
} else {
|
||||
if (nav_gop.found_existing)
|
||||
@ -2733,7 +2733,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
|
||||
|
||||
const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern());
|
||||
if (type_gop.found_existing) {
|
||||
dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).clear();
|
||||
if (dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).len > 0) break :tag .decl_alias;
|
||||
nav_gop.value_ptr.* = type_gop.value_ptr.*;
|
||||
} else {
|
||||
if (nav_gop.found_existing)
|
||||
@ -2788,7 +2788,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
|
||||
|
||||
const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern());
|
||||
if (type_gop.found_existing) {
|
||||
dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).clear();
|
||||
if (dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).len > 0) break :tag .decl_alias;
|
||||
nav_gop.value_ptr.* = type_gop.value_ptr.*;
|
||||
} else {
|
||||
if (nav_gop.found_existing)
|
||||
@ -2879,7 +2879,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
|
||||
|
||||
const type_gop = try dwarf.types.getOrPut(dwarf.gpa, nav_val.toIntern());
|
||||
if (type_gop.found_existing) {
|
||||
dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).clear();
|
||||
if (dwarf.debug_info.section.getUnit(wip_nav.unit).getEntry(type_gop.value_ptr.*).len > 0) break :tag .decl_alias;
|
||||
nav_gop.value_ptr.* = type_gop.value_ptr.*;
|
||||
} else {
|
||||
if (nav_gop.found_existing)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user