Skip to content

Commit 8306f55

Browse files
committed
[DWARF] Eliminate the DWARFDebugNames::Header::Padding field.
The padding field is reserved for DWARF and does not contain any useful information. No need to read, store and report it. Differential Revision: https://reviews.llvm.org/D73042
1 parent 99960de commit 8306f55

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
231231
struct Header {
232232
uint32_t UnitLength;
233233
uint16_t Version;
234-
uint16_t Padding;
235234
uint32_t CompUnitCount;
236235
uint32_t LocalTypeUnitCount;
237236
uint32_t ForeignTypeUnitCount;

llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ void DWARFDebugNames::Header::dump(ScopedPrinter &W) const {
366366
DictScope HeaderScope(W, "Header");
367367
W.printHex("Length", UnitLength);
368368
W.printNumber("Version", Version);
369-
W.printHex("Padding", Padding);
370369
W.printNumber("CU count", CompUnitCount);
371370
W.printNumber("Local TU count", LocalTypeUnitCount);
372371
W.printNumber("Foreign TU count", ForeignTypeUnitCount);
@@ -397,7 +396,8 @@ Error DWARFDebugNames::Header::extract(const DWARFDataExtractor &AS,
397396

398397
UnitLength = AS.getU32(Offset);
399398
Version = AS.getU16(Offset);
400-
Padding = AS.getU16(Offset);
399+
// Skip padding
400+
*Offset += 2;
401401
CompUnitCount = AS.getU32(Offset);
402402
LocalTypeUnitCount = AS.getU32(Offset);
403403
ForeignTypeUnitCount = AS.getU32(Offset);

llvm/test/DebugInfo/X86/dwarfdump-debug-names.s

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
# CHECK-NEXT: Header {
9999
# CHECK-NEXT: Length: 0x60
100100
# CHECK-NEXT: Version: 5
101-
# CHECK-NEXT: Padding: 0x0
102101
# CHECK-NEXT: CU count: 1
103102
# CHECK-NEXT: Local TU count: 0
104103
# CHECK-NEXT: Foreign TU count: 0
@@ -144,7 +143,6 @@
144143
# CHECK-NEXT: Header {
145144
# CHECK-NEXT: Length: 0x44
146145
# CHECK-NEXT: Version: 5
147-
# CHECK-NEXT: Padding: 0x0
148146
# CHECK-NEXT: CU count: 1
149147
# CHECK-NEXT: Local TU count: 0
150148
# CHECK-NEXT: Foreign TU count: 0

0 commit comments

Comments
 (0)