[DWARFYAML] Use yaml::Hex64 rather than uint64_t as length. NFC.
authorXing GUO <higuoxing@gmail.com>
Wed, 22 Jul 2020 02:16:52 +0000 (10:16 +0800)
committerXing GUO <higuoxing@gmail.com>
Wed, 22 Jul 2020 02:20:01 +0000 (10:20 +0800)
It's better to use yaml::Hex64 as length in the compilation unit.

llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml

index 4ece647..a4cad0f 100644 (file)
@@ -120,7 +120,7 @@ struct DWARFContext {
 
 struct Unit {
   dwarf::DwarfFormat Format;
-  uint64_t Length;
+  yaml::Hex64 Length;
   uint16_t Version;
   llvm::dwarf::UnitType Type; // Added in DWARF 5
   yaml::Hex64 AbbrOffset;
index 98af99b..1ca45f5 100644 (file)
@@ -513,7 +513,7 @@ DWARF:
 
 #      DWARF32: DWARF:
 #      DWARF32:   debug_info:
-# DWARF32-NEXT:     - Length:     117
+# DWARF32-NEXT:     - Length:     0x0000000000000075
 # DWARF32-NEXT:       Version:    4
 # DWARF32-NEXT:       AbbrOffset: 0
 # DWARF32-NEXT:       AddrSize:   8
@@ -584,7 +584,7 @@ DWARF:
 # RUN:   obj2yaml | FileCheck %s --check-prefix=DWARF32-YAML
 
 #      DWARF32-YAML: debug_info:
-# DWARF32-YAML-NEXT:   - Length:     12
+# DWARF32-YAML-NEXT:   - Length:     0x000000000000000C
 # DWARF32-YAML-NEXT:     Version:    4
 # DWARF32-YAML-NEXT:     AbbrOffset: 0
 # DWARF32-YAML-NEXT:     AddrSize:   8
@@ -666,7 +666,7 @@ DWARF:
 
 #      DWARF64-YAML: debug_info:
 # DWARF64-YAML-NEXT:   - Format:     DWARF64
-# DWARF64-YAML-NEXT:     Length:     12
+# DWARF64-YAML-NEXT:     Length:     0x000000000000000C
 # DWARF64-YAML-NEXT:     Version:    4
 # DWARF64-YAML-NEXT:     AbbrOffset: 0
 # DWARF64-YAML-NEXT:     AddrSize:   8
index 142ed0a..b8e3616 100644 (file)
@@ -415,7 +415,7 @@ DWARF:
 ...
 
 #CHECK:   debug_info:      
-#CHECK:     - Length:          168
+#CHECK:     - Length:          0x00000000000000A8
 #CHECK:       Version:         2
 #CHECK:       AbbrOffset:      0
 #CHECK:       AddrSize:        8
index 1ed156a..fc22800 100644 (file)
@@ -513,7 +513,7 @@ DWARF:
 
 #      DWARF32: DWARF:
 #      DWARF32:   debug_info:
-# DWARF32-NEXT:     - Length:     118
+# DWARF32-NEXT:     - Length:     0x0000000000000076
 # DWARF32-NEXT:       Version:    5
 # DWARF32-NEXT:       UnitType:   DW_UT_compile
 # DWARF32-NEXT:       AbbrOffset: 0
@@ -585,7 +585,7 @@ DWARF:
 # RUN:   obj2yaml | FileCheck %s --check-prefix=DWARF32-YAML
 
 #      DWARF32-YAML: debug_info:
-# DWARF32-YAML-NEXT:   - Length:     12
+# DWARF32-YAML-NEXT:   - Length:     0x000000000000000C
 # DWARF32-YAML-NEXT:     Version:    5
 # DWARF32-YAML-NEXT:     UnitType:   DW_UT_compile
 # DWARF32-YAML-NEXT:     AbbrOffset: 0x0000000000000000
@@ -669,7 +669,7 @@ DWARF:
 
 #      DWARF64-YAML: debug_info:
 # DWARF64-YAML-NEXT:   - Format:     DWARF64
-# DWARF64-YAML-NEXT:     Length:     20
+# DWARF64-YAML-NEXT:     Length:     0x0000000000000014
 # DWARF64-YAML-NEXT:     Version:    5
 # DWARF64-YAML-NEXT:     UnitType:   DW_UT_compile
 # DWARF64-YAML-NEXT:     AbbrOffset: 0x0000000000000000