[llvm] 8306f55 - [DWARF] Eliminate the DWARFDebugNames::Header::Padding field.
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 00:14:28 PST 2020
Author: Igor Kudrin
Date: 2020-01-23T15:11:58+07:00
New Revision: 8306f55bfa2b14ac4289c6f1d3ab5c4a64d37f6b
URL: https://github.com/llvm/llvm-project/commit/8306f55bfa2b14ac4289c6f1d3ab5c4a64d37f6b
DIFF: https://github.com/llvm/llvm-project/commit/8306f55bfa2b14ac4289c6f1d3ab5c4a64d37f6b.diff
LOG: [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
Added:
Modified:
llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
llvm/test/DebugInfo/X86/dwarfdump-debug-names.s
Removed:
################################################################################
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
index b60aef90871d..f1e02aae5564 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
@@ -231,7 +231,6 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
struct Header {
uint32_t UnitLength;
uint16_t Version;
- uint16_t Padding;
uint32_t CompUnitCount;
uint32_t LocalTypeUnitCount;
uint32_t ForeignTypeUnitCount;
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
index 07760a8ec78f..afd519013d82 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
@@ -366,7 +366,6 @@ void DWARFDebugNames::Header::dump(ScopedPrinter &W) const {
DictScope HeaderScope(W, "Header");
W.printHex("Length", UnitLength);
W.printNumber("Version", Version);
- W.printHex("Padding", Padding);
W.printNumber("CU count", CompUnitCount);
W.printNumber("Local TU count", LocalTypeUnitCount);
W.printNumber("Foreign TU count", ForeignTypeUnitCount);
@@ -397,7 +396,8 @@ Error DWARFDebugNames::Header::extract(const DWARFDataExtractor &AS,
UnitLength = AS.getU32(Offset);
Version = AS.getU16(Offset);
- Padding = AS.getU16(Offset);
+ // Skip padding
+ *Offset += 2;
CompUnitCount = AS.getU32(Offset);
LocalTypeUnitCount = AS.getU32(Offset);
ForeignTypeUnitCount = AS.getU32(Offset);
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-debug-names.s b/llvm/test/DebugInfo/X86/dwarfdump-debug-names.s
index 2b28c07533d7..ccfb6fc538f7 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-debug-names.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-debug-names.s
@@ -98,7 +98,6 @@
# CHECK-NEXT: Header {
# CHECK-NEXT: Length: 0x60
# CHECK-NEXT: Version: 5
-# CHECK-NEXT: Padding: 0x0
# CHECK-NEXT: CU count: 1
# CHECK-NEXT: Local TU count: 0
# CHECK-NEXT: Foreign TU count: 0
@@ -144,7 +143,6 @@
# CHECK-NEXT: Header {
# CHECK-NEXT: Length: 0x44
# CHECK-NEXT: Version: 5
-# CHECK-NEXT: Padding: 0x0
# CHECK-NEXT: CU count: 1
# CHECK-NEXT: Local TU count: 0
# CHECK-NEXT: Foreign TU count: 0
More information about the llvm-commits
mailing list