DebugInfo: Tidy up initializing multi-section contributions in DWARFContext

This commit is contained in:
David Blaikie 2020-09-18 10:54:02 -07:00
parent a1aa330b20
commit e0802fe016
1 changed files with 9 additions and 8 deletions

View File

@ -1711,16 +1711,17 @@ public:
// FIXME: Use the other dwo range section when we emit it. // FIXME: Use the other dwo range section when we emit it.
RangesDWOSection.Data = Data; RangesDWOSection.Data = Data;
} }
} else if (Name == "debug_info") { } else if (InfoSectionMap *Sections =
StringSwitch<InfoSectionMap *>(Name)
.Case("debug_info", &InfoSections)
.Case("debug_info.dwo", &InfoDWOSections)
.Case("debug_types", &TypesSections)
.Case("debug_types.dwo", &TypesDWOSections)
.Default(nullptr)) {
// Find debug_info and debug_types data by section rather than name as // Find debug_info and debug_types data by section rather than name as
// there are multiple, comdat grouped, of these sections. // there are multiple, comdat grouped, of these sections.
InfoSections[Section].Data = Data; DWARFSectionMap &S = (*Sections)[Section];
} else if (Name == "debug_info.dwo") { S.Data = Data;
InfoDWOSections[Section].Data = Data;
} else if (Name == "debug_types") {
TypesSections[Section].Data = Data;
} else if (Name == "debug_types.dwo") {
TypesDWOSections[Section].Data = Data;
} }
if (RelocatedSection == Obj.section_end()) if (RelocatedSection == Obj.section_end())