File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
include/llvm/DebugInfo/DWARF Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -557,6 +557,7 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
557
557
uint64_t StringOffsetsBase;
558
558
uint64_t EntryOffsetsBase;
559
559
uint64_t EntriesBase;
560
+ bool HasIdxParent = false ;
560
561
561
562
void dumpCUs (ScopedPrinter &W) const ;
562
563
void dumpLocalTUs (ScopedPrinter &W) const ;
@@ -770,6 +771,13 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
770
771
// / Return the Name Index covering the compile unit at CUOffset, or nullptr if
771
772
// / there is no Name Index covering that unit.
772
773
const NameIndex *getCUNameIndex (uint64_t CUOffset);
774
+
775
+ // / Returns true if all the NameIndices in this table provide IDX_parent
776
+ // / capabilities.
777
+ bool supportsIdxParent () const {
778
+ return all_of (NameIndices,
779
+ [](const NameIndex &Idx) { return Idx.HasIdxParent ; });
780
+ }
773
781
};
774
782
775
783
// / If `Name` is the name of a templated function that includes template
Original file line number Diff line number Diff line change @@ -578,13 +578,18 @@ Error DWARFDebugNames::NameIndex::extract() {
578
578
" Section too small: cannot read abbreviations." );
579
579
580
580
EntriesBase = Offset + Hdr.AbbrevTableSize ;
581
+ HasIdxParent = false ;
582
+ auto IsIdxParent = [](auto IdxFormPair) {
583
+ return IdxFormPair.Index == dwarf::Index::DW_IDX_parent;
584
+ };
581
585
582
586
for (;;) {
583
587
auto AbbrevOr = extractAbbrev (&Offset);
584
588
if (!AbbrevOr)
585
589
return AbbrevOr.takeError ();
586
590
if (isSentinel (*AbbrevOr))
587
591
return Error::success ();
592
+ HasIdxParent |= any_of (AbbrevOr->Attributes , IsIdxParent);
588
593
589
594
if (!Abbrevs.insert (std::move (*AbbrevOr)).second )
590
595
return createStringError (errc::invalid_argument,
You can’t perform that action at this time.
0 commit comments