Skip to content

Commit e2063e1

Browse files
Merge pull request #8576 from rastogishubham/NewCASBlocks
Create new CAS Blocks to represent missing DWARF sections
2 parents 77de02a + 71bb893 commit e2063e1

File tree

5 files changed

+827
-41
lines changed

5 files changed

+827
-41
lines changed

llvm/include/llvm/MCCAS/MCCASObjectV1.def

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ CASV1_SIMPLE_DATA_REF(DataInCodeRef, mc:data_in_code)
1818
CASV1_SIMPLE_DATA_REF(CStringRef, mc:cstring)
1919
CASV1_SIMPLE_DATA_REF(MergedFragmentRef, mc:merged_fragment)
2020
CASV1_SIMPLE_DATA_REF(DebugStrRef, mc:debug_string)
21+
CASV1_SIMPLE_DATA_REF(DebugStrOffsetsRef, mc:debug_string_offsets)
22+
CASV1_SIMPLE_DATA_REF(DebugLocRef, mc:debug_loc)
23+
CASV1_SIMPLE_DATA_REF(DebugLoclistsRef, mc:debug_loclists)
24+
CASV1_SIMPLE_DATA_REF(DebugRangesRef, mc:debug_ranges)
25+
CASV1_SIMPLE_DATA_REF(DebugRangelistsRef, mc:debug_rangelists)
26+
CASV1_SIMPLE_DATA_REF(DebugNamesRef, mc:debug_names)
27+
CASV1_SIMPLE_DATA_REF(AppleNamesRef, mc:apple_names)
28+
CASV1_SIMPLE_DATA_REF(AppleTypesRef, mc:apple_types)
29+
CASV1_SIMPLE_DATA_REF(AppleNamespaceRef, mc:apple_namespac)
30+
CASV1_SIMPLE_DATA_REF(AppleObjCRef, mc:apple_objc)
2131
CASV1_SIMPLE_DATA_REF(DebugLineRef, mc:debug_line)
2232
CASV1_SIMPLE_DATA_REF(DebugLineUnoptRef, mc:debug_line_unopt)
33+
CASV1_SIMPLE_DATA_REF(DebugLineStrRef, mc:debug_line_str)
2334
CASV1_SIMPLE_DATA_REF(DebugInfoUnoptRef, mc:debug_info_unopt)
2435
CASV1_SIMPLE_DATA_REF(DebugAbbrevUnoptRef, mc:debug_abbrev_unopt)
2536
CASV1_SIMPLE_DATA_REF(DistinctDebugLineRef, mc:debug_line_distinct_data)
@@ -37,9 +48,20 @@ CASV1_SIMPLE_GROUP_REF(GroupRef, mc:group)
3748
CASV1_SIMPLE_GROUP_REF(SectionRef, mc:section)
3849
CASV1_SIMPLE_GROUP_REF(DebugAbbrevSectionRef, mc:debug_abbrev_section)
3950
CASV1_SIMPLE_GROUP_REF(DebugLineSectionRef, mc:debug_line_section)
51+
CASV1_SIMPLE_GROUP_REF(DebugLineStrSectionRef, mc:debug_line_str_section)
4052
CASV1_SIMPLE_GROUP_REF(AtomRef, mc:atom)
4153
CASV1_SIMPLE_GROUP_REF(SymbolTableRef, mc:symbol_table)
4254
CASV1_SIMPLE_GROUP_REF(DebugStringSectionRef, mc:debug_string_section)
55+
CASV1_SIMPLE_GROUP_REF(DebugStringOffsetsSectionRef, mc:debug_string_offsets_section)
56+
CASV1_SIMPLE_GROUP_REF(DebugLocSectionRef, mc:debug_loc_section)
57+
CASV1_SIMPLE_GROUP_REF(DebugLoclistsSectionRef, mc:debug_loclists_section)
58+
CASV1_SIMPLE_GROUP_REF(DebugRangesSectionRef, mc:debug_ranges_section)
59+
CASV1_SIMPLE_GROUP_REF(DebugRangelistsSectionRef, mc:debug_rangelists_section)
60+
CASV1_SIMPLE_GROUP_REF(DebugNamesSectionRef, mc:debug_names_section)
61+
CASV1_SIMPLE_GROUP_REF(AppleNamesSectionRef, mc:apple_names_section)
62+
CASV1_SIMPLE_GROUP_REF(AppleTypesSectionRef, mc:apple_types_section)
63+
CASV1_SIMPLE_GROUP_REF(AppleNamespaceSectionRef, mc:apple_namepsac_section)
64+
CASV1_SIMPLE_GROUP_REF(AppleObjCSectionRef, mc:apple_objc_section)
4365
CASV1_SIMPLE_GROUP_REF(DIEAbbrevSetRef, mc:debug_DIE_abbrev_set)
4466
CASV1_SIMPLE_GROUP_REF(DIETopLevelRef, mc:debug_DIE_top_level)
4567
CASV1_SIMPLE_GROUP_REF(DIEDedupeTopLevelRef, mc:debug_DIE_Dedupe_top_level)

llvm/include/llvm/MCCAS/MCCASObjectV1.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,16 @@ struct DwarfSectionsCache {
480480
MCSection *Str;
481481
MCSection *Abbrev;
482482
MCSection *StrOffsets;
483+
MCSection *Loc;
484+
MCSection *Loclists;
485+
MCSection *Ranges;
486+
MCSection *Rangelists;
487+
MCSection *LineStr;
488+
MCSection *Names;
489+
MCSection *AppleNames;
490+
MCSection *AppleTypes;
491+
MCSection *AppleNamespace;
492+
MCSection *AppleObjC;
483493
};
484494

485495
/// Queries `Asm` for all dwarf sections and returns an object with (possibly
@@ -578,6 +588,9 @@ class MCCASBuilder {
578588

579589
Expected<SmallVector<DebugStrRef, 0>> createDebugStringRefs();
580590

591+
template <typename SectionTy>
592+
std::optional<Expected<SectionTy>> createGenericDebugRef(MCSection *Section);
593+
581594
struct CUSplit {
582595
SmallVector<MutableArrayRef<char>> SplitCUData;
583596
SmallVector<size_t> AbbrevOffsets;
@@ -596,6 +609,50 @@ class MCCASBuilder {
596609
// string in the section.
597610
Error createDebugStrSection();
598611

612+
// If a DWARF String Offsets section exists, create a DebugStrOffsetsRef CAS
613+
// object for the section.
614+
Error createDebugStrOffsetsSection();
615+
616+
// If a DWARF Loc section exists, create a DebugLocRef CAS object for the
617+
// section.
618+
Error createDebugLocSection();
619+
620+
// If a DWARF Loclists section exists, create a DebugLoclistsRef CAS
621+
// object for the section.
622+
Error createDebugLoclistsSection();
623+
624+
// If a DWARF Ranges section exists, create a DebugRangesRef CAS
625+
// object for the section.
626+
Error createDebugRangesSection();
627+
628+
// If a DWARF Rangeslists section exists, create a DebugRangeslistsRef CAS
629+
// object for the section.
630+
Error createDebugRangelistsSection();
631+
632+
// If a DWARF LineStr section exists, create a DebugLineStrRef CAS
633+
// object for the section.
634+
Error createDebugLineStrSection();
635+
636+
// If a DWARF Names section exists, create a DebugNamesRef CAS
637+
// object for the section.
638+
Error createDebugNamesSection();
639+
640+
// If a DWARF Apple Names section exists, create a AppleNamesRef CAS
641+
// object for the section.
642+
Error createAppleNamesSection();
643+
644+
// If a DWARF Apple Types section exists, create a AppleTypesRef CAS
645+
// object for the section.
646+
Error createAppleTypesSection();
647+
648+
// If a DWARF Apple Namespaces section exists, create a AppleNamespaceRef CAS
649+
// object for the section.
650+
Error createAppleNamespaceSection();
651+
652+
// If a DWARF Apple Objc section exists, create a AppleObjcRef CAS
653+
// object for the section.
654+
Error createAppleObjCSection();
655+
599656
/// If there is any padding between one section and the next, create a
600657
/// PaddingRef CAS object to represent the bytes of Padding between the two
601658
/// sections.

0 commit comments

Comments
 (0)