File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
include/llvm/DebugInfo/DWARF Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -468,12 +468,13 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
468
468
// / index for an entry that is a type unit.
469
469
std::optional<uint64_t > getRelatedCUIndex () const ;
470
470
471
- // / Returns the Index into the Local Type Unit list of the owning Name
471
+ // / Returns the index of the Type Unit of the owning
472
+ // / Name
472
473
// / Index or std::nullopt if this Accelerator Entry does not have an
473
474
// / associated Type Unit. It is up to the user to verify that the
474
- // / returned Index is valid in the owning NameIndex (or use
475
+ // / returned Index is a valid index in the owning NameIndex (or use
475
476
// / getLocalTUOffset(), which will handle that check itself).
476
- std::optional<uint64_t > getLocalTUIndex () const ;
477
+ std::optional<uint64_t > getTUIndex () const ;
477
478
478
479
// / .debug_names-specific getter, which always succeeds (DWARF v5 index
479
480
// / entries always have a tag).
Original file line number Diff line number Diff line change @@ -665,15 +665,15 @@ std::optional<uint64_t> DWARFDebugNames::Entry::getRelatedCUOffset() const {
665
665
}
666
666
667
667
std::optional<uint64_t > DWARFDebugNames::Entry::getLocalTUOffset () const {
668
- std::optional<uint64_t > Index = getLocalTUIndex ();
668
+ std::optional<uint64_t > Index = getTUIndex ();
669
669
if (!Index || *Index >= NameIdx->getLocalTUCount ())
670
670
return std::nullopt;
671
671
return NameIdx->getLocalTUOffset (*Index);
672
672
}
673
673
674
674
std::optional<uint64_t >
675
675
DWARFDebugNames::Entry::getForeignTUTypeSignature () const {
676
- std::optional<uint64_t > Index = getLocalTUIndex ();
676
+ std::optional<uint64_t > Index = getTUIndex ();
677
677
const uint32_t NumLocalTUs = NameIdx->getLocalTUCount ();
678
678
if (!Index || *Index < NumLocalTUs)
679
679
return std::nullopt; // Invalid TU index or TU index is for a local TU
@@ -684,7 +684,7 @@ DWARFDebugNames::Entry::getForeignTUTypeSignature() const {
684
684
return NameIdx->getForeignTUSignature (ForeignTUIndex);
685
685
}
686
686
687
- std::optional<uint64_t > DWARFDebugNames::Entry::getLocalTUIndex () const {
687
+ std::optional<uint64_t > DWARFDebugNames::Entry::getTUIndex () const {
688
688
if (std::optional<DWARFFormValue> Off = lookup (dwarf::DW_IDX_type_unit))
689
689
return Off->getAsUnsignedConstant ();
690
690
return std::nullopt;
Original file line number Diff line number Diff line change @@ -1587,7 +1587,7 @@ unsigned DWARFVerifier::verifyNameIndexEntries(
1587
1587
EntryOr = NI.getEntry (&NextEntryID)) {
1588
1588
1589
1589
std::optional<uint64_t > CUIndex = EntryOr->getRelatedCUIndex ();
1590
- std::optional<uint64_t > TUIndex = EntryOr->getLocalTUIndex ();
1590
+ std::optional<uint64_t > TUIndex = EntryOr->getTUIndex ();
1591
1591
if (CUIndex && *CUIndex >= NI.getCUCount ()) {
1592
1592
ErrorCategory.Report (" Name Index entry contains invalid CU index" , [&]() {
1593
1593
error () << formatv (" Name Index @ {0:x}: Entry @ {1:x} contains an "
@@ -1677,7 +1677,7 @@ unsigned DWARFVerifier::verifyNameIndexEntries(
1677
1677
DWARFUnit *NonSkeletonUnit = nullptr ;
1678
1678
if (TUIndex && *TUIndex >= NumLocalTUs) {
1679
1679
// We have a foreign TU index, which either means we have a .dwo file
1680
- // that has one or more type units, or we have a .dwp file with on or
1680
+ // that has one or more type units, or we have a .dwp file with one or
1681
1681
// more type units. We need to get the type unit from the DWARFContext
1682
1682
// of the .dwo. We got the NonSkeletonUnitDie above that has the .dwo
1683
1683
// or .dwp DWARF context, so we have to get the type unit from that file.
You can’t perform that action at this time.
0 commit comments