Higuoxing created this revision.
Higuoxing added reviewers: jhenderson, grimar, MaskRay.
Herald added subscribers: llvm-commits, lldb-commits, cmtice, arphaman, 
hiraditya, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a reviewer: rupprecht.
Herald added projects: LLDB, LLVM.
Higuoxing requested review of this revision.
Herald added a subscriber: JDevlieghere.

This patch makes the include_directories, file_names and opcodes fields
of the line table optional. This helps us simplify some tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87878

Files:
  lldb/unittests/Symbol/Inputs/inlined-functions.yaml
  llvm/lib/ObjectYAML/DWARFYAML.cpp
  llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
  llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
  llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
  llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
  llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml
  llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
  llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
  llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
  llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml

Index: llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml
===================================================================
--- llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml
+++ llvm/test/tools/yaml2obj/ELF/DWARF/debug-line.yaml
@@ -92,7 +92,6 @@
           DirIdx:  2
           ModTime: 3
           Length:  4
-      Opcodes: []
 
 ## Generate and verify a big endian DWARF32 .debug_line section.
 
@@ -211,9 +210,6 @@
       LineRange:             14
       OpcodeBase:            13
       StandardOpcodeLengths: []
-      IncludeDirs:           []
-      Files:                 []
-      Opcodes:               []
 
 ## e) Test that yaml2obj emits an error message when both the "Content" and the
 ## "debug_line" entry are specified at the same time.
@@ -240,9 +236,6 @@
       LineRange:             14
       OpcodeBase:            13
       StandardOpcodeLengths: []
-      IncludeDirs:           []
-      Files:                 []
-      Opcodes:               []
 
 ## f) Test that all the properties can be overridden by the section header when
 ## the "debug_line" entry doesn't exist.
@@ -307,9 +300,6 @@
       LineRange:             14
       OpcodeBase:            13
       StandardOpcodeLengths: []
-      IncludeDirs:           []
-      Files:                 []
-      Opcodes:               []
 
 ## h) Test that the address size is inferred from the target machine.
 
@@ -355,8 +345,6 @@
       LineRange:             14
       OpcodeBase:            13
       StandardOpcodeLengths: []
-      IncludeDirs:           []
-      Files:                 []
       Opcodes:
         - Opcode:    DW_LNS_extended_op
           ExtLen:    9
@@ -439,8 +427,6 @@
       LineRange:             14
       OpcodeBase:            13
       StandardOpcodeLengths: []
-      IncludeDirs:           []
-      Files:                 []
       Opcodes:
         - Opcode:    DW_LNS_copy
         - Opcode:    DW_LNS_advance_pc
Index: llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
===================================================================
--- llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
+++ llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml
@@ -469,7 +469,6 @@
       LineRange:       14
       OpcodeBase:      13
       StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-      IncludeDirs:     []
       Files:
         - Name:            strip-test.c
           DirIdx:          0
Index: llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
===================================================================
--- llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
+++ llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
@@ -688,7 +688,6 @@
       LineRange:       14
       OpcodeBase:      13
       StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-      IncludeDirs:     []
       Files:
         - Name:            main.cpp
           DirIdx:          0
Index: llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
===================================================================
--- llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
+++ llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
@@ -472,7 +472,6 @@
           LineRange:       14
           OpcodeBase:      13
           StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-          IncludeDirs:     []
           Files:
             - Name:            main.cpp
               DirIdx:          0
@@ -941,7 +940,6 @@
           LineRange:       14
           OpcodeBase:      13
           StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-          IncludeDirs:     []
           Files:
             - Name:            main.cpp
               DirIdx:          0
Index: llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml
+++ llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml
@@ -113,6 +113,4 @@
       StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
       IncludeDirs:
         - '/tmp'
-      Files:
-      Opcodes:         []
 ...
Index: llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
+++ llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
@@ -118,5 +118,4 @@
           DirIdx:          1
           ModTime:         0
           Length:          0
-      Opcodes:         []
 ...
Index: llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
===================================================================
--- llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
+++ llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
@@ -479,7 +479,6 @@
         - 0
         - 0
         - 1
-      IncludeDirs:     
       Files:           
         - Name:            hello_world.c
           DirIdx:          0
Index: llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
===================================================================
--- llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
+++ llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
@@ -499,7 +499,6 @@
       LineRange:       14
       OpcodeBase:      13
       StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-      IncludeDirs:     
       Files:           
         - Name:            hello_world.c
           DirIdx:          0
@@ -540,7 +539,6 @@
 # CHECK-NEXT:     LineRange:       14
 # CHECK-NEXT:     OpcodeBase:      13
 # CHECK-NEXT:     StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-# CHECK-NEXT:     IncludeDirs:
 # CHECK-NEXT:     Files:
 # CHECK-NEXT:       - Name:            hello_world.c
 # CHECK-NEXT:         DirIdx:          0
Index: llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
===================================================================
--- llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
+++ llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
@@ -478,7 +478,6 @@
         - 0
         - 0
         - 1
-      IncludeDirs:     
       Files:           
         - Name:            hello_world.c
           DirIdx:          0
Index: llvm/lib/ObjectYAML/DWARFYAML.cpp
===================================================================
--- llvm/lib/ObjectYAML/DWARFYAML.cpp
+++ llvm/lib/ObjectYAML/DWARFYAML.cpp
@@ -246,9 +246,9 @@
   IO.mapRequired("LineRange", LineTable.LineRange);
   IO.mapRequired("OpcodeBase", LineTable.OpcodeBase);
   IO.mapRequired("StandardOpcodeLengths", LineTable.StandardOpcodeLengths);
-  IO.mapRequired("IncludeDirs", LineTable.IncludeDirs);
-  IO.mapRequired("Files", LineTable.Files);
-  IO.mapRequired("Opcodes", LineTable.Opcodes);
+  IO.mapOptional("IncludeDirs", LineTable.IncludeDirs);
+  IO.mapOptional("Files", LineTable.Files);
+  IO.mapOptional("Opcodes", LineTable.Opcodes);
 }
 
 void MappingTraits<DWARFYAML::SegAddrPair>::mapping(
Index: lldb/unittests/Symbol/Inputs/inlined-functions.yaml
===================================================================
--- lldb/unittests/Symbol/Inputs/inlined-functions.yaml
+++ lldb/unittests/Symbol/Inputs/inlined-functions.yaml
@@ -711,7 +711,6 @@
       LineRange:       14
       OpcodeBase:      13
       StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
-      IncludeDirs:     []
       Files:           
         - Name:            inlined-functions.cpp
           DirIdx:          0
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to