[PATCH] D96035: [dsymutil][DWARFlinker] implement separate multi-thread processing for compile units.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 13:36:51 PST 2022


avl added a comment.

In D96035#3223263 <https://reviews.llvm.org/D96035#3223263>, @dblaikie wrote:

> You can use cross-unit references (`DW_FORM_sec_offset`) to have one type/DIE in one unit refer to a type/DIE in another unit. So they could still be moved to/handled in a common way, but split up into multiple units to avoid pathological cases in DWARF consumers that might tend to load whole units at a time. Would that be feasible? (not sure if such consumers also then have common pathologies where they load all units that a unit references via `DW_FORM_sec_offset`... if they do, then the solution becomes more difficult and would involve either putting every type in a separate unit or finding groups of related types to put together, rather than arbitrary grouping - @clayborg do you know if lldb has that sort of behavior? (where it'd try to load all referenced units from a unit it's loading))

If I understood correctly - you are talking here more about splitting the current global type table between several artificial type tables.
Which is an additional problem, but not what I was talking about. I tried to describe situation when a class ("A") contains information for global
namespace and for anonymous namespace:

  DW_TAG_structure_type                                               | global&anonymous
    DW_AT_calling_convention        (DW_CC_pass_by_value)             | global&anonymous
    DW_AT_name      ("A")                                             | global&anonymous
    DW_AT_byte_size (0x01)                                            | global&anonymous
    DW_AT_decl_file ("/home/avl/test_templates1/./a.h")               | global&anonymous
    DW_AT_decl_line (1)                                               | global&anonymous
  
    DW_TAG_subprogram                                                 | anonymous
      DW_AT_linkage_name    ("_ZN1A3fooIN12_GLOBAL__N_11BEEET_v")     | anonymous
      DW_AT_name    ("foo<(anonymous namespace)::B>")                 | anonymous
      DW_AT_decl_file       ("/home/avl/test_templates1/./a.h")       | anonymous
      DW_AT_decl_line       (3)                                       | anonymous
      DW_AT_type    (0x0000016d "(anonymous namespace)::B")           | anonymous
      DW_AT_declaration     (true)                                    | anonymous
  
      DW_TAG_template_type_parameter                                  | anonymous
        DW_AT_type  (0x0000016d "(anonymous namespace)::B")           | anonymous
        DW_AT_name  ("T")                                             | anonymous
  
      DW_TAG_formal_parameter                                         | anonymous
        DW_AT_type  (0x000001b3 "A *")                                | anonymous
        DW_AT_artificial    (true)                                    | anonymous
  
      NULL                                                            | anonymous
      
    DW_TAG_subprogram                                                 | global
      DW_AT_linkage_name    ("another member of A")                   | global
      DW_AT_name    ("another member of A")                           | global
      
    NULL                                                              | global&anonymous

  Thus it should be split into two parts. One should go to the global type table:


  DW_TAG_structure_type                                               
    DW_AT_calling_convention        (DW_CC_pass_by_value)             
    DW_AT_name      ("A")                                             
    DW_AT_byte_size (0x01)                                           
    DW_AT_decl_file ("/home/avl/test_templates1/./a.h")              
    DW_AT_decl_line (1)                                              
  
    DW_TAG_subprogram                                                
      DW_AT_linkage_name    ("another member of A")                  
      DW_AT_name    ("another member of A")                          
      
    NULL                                                             

  Another part should be left into the owning compilation unit.


  DW_TAG_structure_type                                             
  DW_AT_calling_convention        (DW_CC_pass_by_value)             
  DW_AT_name      ("A")                                             
  DW_AT_byte_size (0x01)                                            
  DW_AT_decl_file ("/home/avl/test_templates1/./a.h")               
  DW_AT_decl_line (1)                                               
  
  DW_TAG_subprogram                                                 
    DW_AT_linkage_name    ("_ZN1A3fooIN12_GLOBAL__N_11BEEET_v")     
    DW_AT_name    ("foo<(anonymous namespace)::B>")                 
    DW_AT_decl_file       ("/home/avl/test_templates1/./a.h")       
    DW_AT_decl_line       (3)                                       
    DW_AT_type    (0x0000016d "(anonymous namespace)::B")           
    DW_AT_declaration     (true)                                    
  
    DW_TAG_template_type_parameter                                  
      DW_AT_type  (0x0000016d "(anonymous namespace)::B")           
      DW_AT_name  ("T")                                             
  
    DW_TAG_formal_parameter                                         
      DW_AT_type  (0x000001b3 "A *")                                
      DW_AT_artificial    (true)                                    
  
    NULL                                                            
    
  NULL                                                              

That kind of splitting is not implemented by current patch.
Also that solution would require more space since it duplicates structure description.

Or are you suggesting another solution for that case?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96035/new/

https://reviews.llvm.org/D96035



More information about the llvm-commits mailing list