[llvm] e4ef948 - [DWARFYAML] Use yaml::Hex64 rather than uint64_t as length. NFC.

Xing GUO via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 19:20:36 PDT 2020


Author: Xing GUO
Date: 2020-07-22T10:20:01+08:00
New Revision: e4ef948a434325fc12a16dcacf513fbd9390eb06

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

LOG: [DWARFYAML] Use yaml::Hex64 rather than uint64_t as length. NFC.

It's better to use yaml::Hex64 as length in the compilation unit.

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index 4ece647655bf..a4cad0fe567c 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -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;

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
index 98af99b86e0a..1ca45f5dadfe 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
@@ -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

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml b/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
index 142ed0ac02ea..b8e361620663 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
@@ -415,7 +415,7 @@ DWARF:
 ...
 
 #CHECK:   debug_info:      
-#CHECK:     - Length:          168
+#CHECK:     - Length:          0x00000000000000A8
 #CHECK:       Version:         2
 #CHECK:       AbbrOffset:      0
 #CHECK:       AddrSize:        8

diff  --git a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
index 1ed156a63599..fc2280066c0c 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
@@ -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


        


More information about the llvm-commits mailing list