Skip to content

Commit db76e70

Browse files
Remove DebugStringOffsets section from InMemoryCASDWARFObject.
In rare cases (like in the case of armv7-cas.ll), where we still produce DWARF4, we are still trying to read the information from a non-existent DebugStringOffsets section. We do not need the data from that section to partition compile units. That code has been removed
1 parent 1785ea3 commit db76e70

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

llvm/lib/MCCAS/MCCASObjectV1.cpp

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,20 @@ class AbbrevSetWriter;
8181
/// debug info.
8282
class InMemoryCASDWARFObject : public DWARFObject {
8383
ArrayRef<char> DebugAbbrevSection;
84-
DWARFSection DebugStringOffsetsSection;
8584
bool IsLittleEndian;
8685
uint8_t AddressSize;
8786

8887
public:
89-
InMemoryCASDWARFObject(ArrayRef<char> AbbrevContents,
90-
ArrayRef<char> StringOffsetsContents,
91-
bool IsLittleEndian, uint8_t AddressSize)
92-
: DebugAbbrevSection(AbbrevContents),
93-
DebugStringOffsetsSection({toStringRef(StringOffsetsContents)}),
94-
IsLittleEndian(IsLittleEndian), AddressSize(AddressSize) {}
88+
InMemoryCASDWARFObject(ArrayRef<char> AbbrevContents, bool IsLittleEndian,
89+
uint8_t AddressSize)
90+
: DebugAbbrevSection(AbbrevContents), IsLittleEndian(IsLittleEndian),
91+
AddressSize(AddressSize) {}
9592
bool isLittleEndian() const override { return IsLittleEndian; }
9693

9794
StringRef getAbbrevSection() const override {
9895
return toStringRef(DebugAbbrevSection);
9996
}
10097

101-
const DWARFSection &getStrOffsetsSection() const override {
102-
return DebugStringOffsetsSection;
103-
}
104-
10598
std::optional<RelocAddrEntry> find(const DWARFSection &Sec,
10699
uint64_t Pos) const override {
107100
return {};
@@ -2157,7 +2150,7 @@ Expected<SmallVector<char, 0>>
21572150
MCCASBuilder::mergeMCFragmentContents(const MCSection *Section,
21582151
bool IsDebugLineSection) {
21592152
SmallVector<char, 0> mergedData;
2160-
if (!Section->curFragList())
2153+
if (!Section)
21612154
return mergedData;
21622155
for (const MCFragment &Fragment : *Section) {
21632156
if (Fragment.getKind() == MCFragment::FT_Dwarf) {
@@ -2441,15 +2434,7 @@ Error MCCASBuilder::splitDebugInfoAndAbbrevSections() {
24412434
if (!FullAbbrevData)
24422435
return FullAbbrevData.takeError();
24432436

2444-
const MCSection *StringOffsetsFragmentList = DwarfSections.StrOffsets;
2445-
2446-
Expected<SmallVector<char, 0>> FullStringOffsetsData =
2447-
mergeMCFragmentContents(StringOffsetsFragmentList);
2448-
2449-
if (!FullStringOffsetsData)
2450-
return FullStringOffsetsData.takeError();
2451-
2452-
InMemoryCASDWARFObject CASObj(*FullAbbrevData, *FullStringOffsetsData,
2437+
InMemoryCASDWARFObject CASObj(*FullAbbrevData,
24532438
Asm.getBackend().Endian == endianness::little,
24542439
ObjectWriter.getAddressSize());
24552440
auto DWARFObj = std::make_unique<InMemoryCASDWARFObject>(CASObj);

0 commit comments

Comments
 (0)