[llvm] 8632931 - [DWARFYAML] Make the length field of compilation units optional. NFC.

Xing GUO via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 21:16:38 PDT 2020


Author: Xing GUO
Date: 2020-07-22T12:16:19+08:00
New Revision: 86329317873e46f8bc094b05437a44a1f65c55d6

URL: https://github.com/llvm/llvm-project/commit/86329317873e46f8bc094b05437a44a1f65c55d6
DIFF: https://github.com/llvm/llvm-project/commit/86329317873e46f8bc094b05437a44a1f65c55d6.diff

LOG: [DWARFYAML] Make the length field of compilation units optional. NFC.

This patch makes the length field of compilation units optional (0 by
default).

Added: 
    

Modified: 
    lldb/unittests/Expression/DWARFExpressionTest.cpp
    lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
    llvm/lib/ObjectYAML/DWARFYAML.cpp
    llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
    llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp b/lldb/unittests/Expression/DWARFExpressionTest.cpp
index 78c400c33d4e..ffa3775a6113 100644
--- a/lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -94,8 +94,7 @@ TEST(DWARFExpression, DW_OP_convert) {
       "      - Attribute:       DW_AT_byte_size\n"
       "        Form:            DW_FORM_data1\n"
       "debug_info:\n"
-      "  - Length:          0\n"
-      "    Version:         4\n"
+      "  - Version:         4\n"
       "    AbbrOffset:      0\n"
       "    AddrSize:        8\n"
       "    Entries:\n"

diff  --git a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
index 858aa61b19bb..6b84a21c9d7f 100644
--- a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
+++ b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
@@ -56,8 +56,7 @@ TEST_F(DWARFASTParserClangTests,
       "      - Attribute:       DW_AT_byte_size\n"
       "        Form:            DW_FORM_data1\n"
       "debug_info:\n"
-      "  - Length:          0\n"
-      "    Version:         4\n"
+      "  - Version:         4\n"
       "    AbbrOffset:      0\n"
       "    AddrSize:        8\n"
       "    Entries:\n"

diff  --git a/llvm/lib/ObjectYAML/DWARFYAML.cpp b/llvm/lib/ObjectYAML/DWARFYAML.cpp
index 4cef29a6b428..11eb5779da0e 100644
--- a/llvm/lib/ObjectYAML/DWARFYAML.cpp
+++ b/llvm/lib/ObjectYAML/DWARFYAML.cpp
@@ -143,7 +143,7 @@ void MappingTraits<DWARFYAML::PubSection>::mapping(
 
 void MappingTraits<DWARFYAML::Unit>::mapping(IO &IO, DWARFYAML::Unit &Unit) {
   IO.mapOptional("Format", Unit.Format, dwarf::DWARF32);
-  IO.mapRequired("Length", Unit.Length);
+  IO.mapOptional("Length", Unit.Length, 0);
   IO.mapRequired("Version", Unit.Version);
   if (Unit.Version >= 5)
     IO.mapRequired("UnitType", Unit.Type);

diff  --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 6825981de0c3..459d68b57d8b 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -1368,8 +1368,7 @@ TEST(DWARFDebugInfo, TestEmptyChildren) {
                          "    Children:        DW_CHILDREN_yes\n"
                          "    Attributes:\n"
                          "debug_info:\n"
-                         "  - Length:          0\n"
-                         "    Version:         4\n"
+                         "  - Version:         4\n"
                          "    AbbrOffset:      0\n"
                          "    AddrSize:        8\n"
                          "    Entries:\n"

diff  --git a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
index 983f0624939a..d87f68e2f740 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
@@ -34,8 +34,7 @@ TEST(DWARFDie, getLocations) {
           - Attribute:       DW_AT_call_data_location
             Form:            DW_FORM_sec_offset
     debug_info:
-      - Length:          0
-        Version:         5
+      - Version:         5
         UnitType:        DW_UT_compile
         AbbrOffset:      0
         AddrSize:        4


        


More information about the llvm-commits mailing list