[PATCH] D144181: [clang][DebugInfo] Add abi-tags on constructors/destructors as LLVM annotations

Michael Buch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 17 16:11:05 PST 2023


Michael137 added a comment.

In D144181#4133056 <https://reviews.llvm.org/D144181#4133056>, @Michael137 wrote:

> In D144181#4133025 <https://reviews.llvm.org/D144181#4133025>, @dblaikie wrote:
>
>> Ah, accidentally posted to the lldb part of this stack... instead:
>>
>> Any chance we can make these work more like member functions (could the ctors include their mangled names, for instance)? Or is it the innate nature of ctors having the various C1 <https://reviews.llvm.org/C1>/C2/etc versions?
>
> Initially we tried that in https://reviews.llvm.org/D143652. The existence of multiple constructor definitions which aren't linked to the `DISubprogram` declaration makes it tough. We need to start with a pretty expensive search through the index for all the possible definitions. But then we need to somehow choose the right one to take the linkage name from. And that context isn't available at the point where LLDB parses DWARF.
>
> I'll post some numbers of how much space this would take with Adrian's suggestion and go from there

On second thought, since there are possibly multiple ABI tags per decl and only a single attribute is allowed on a DIE we'd need to somehow encode the ABI tag strings into the single attribute. It's doable but I think the patch as proposed would be more maintainable.

Debug-info size difference for `liblldb.dylib` is below (left is with the annotations, right is without). I.e., debug size difference is ~0.4%

  ---------------------------------------------------------------------------------          
  file: lib/liblldb.dylib.dSYM/Contents/Resources/DWARF/liblldb.dylib                        
  ---------------------------------------------------------------------------------          
  SECTION           SIZE (b)                 SECTION           SIZE (b)                      
  ----------------  ---------                ----------------  ---------                     
  __debug_line       91828488 (8.10%)        __debug_line       91828547 (8.12%)             
  __debug_info      268703597 (23.69%)       __debug_info      265011327 (23.44%)            
  __debug_ranges      2116400 (0.19%)        __debug_ranges      2116400 (0.19%)             
  __debug_aranges      200464 (0.02%)        __debug_aranges      200464 (0.02%)             
  __debug_loc           27234 (0.00%)        __debug_loc           27234 (0.00%)             
  __debug_abbrev        14129 (0.00%)        __debug_abbrev        14117 (0.00%)             
  __debug_str       456849994 (40.28%)       __debug_str       456849978 (40.41%)            
  __apple_names      48851592 (4.31%)        __apple_names      48851592 (4.32%)             
  __apple_namespac     638616 (0.06%)        __apple_namespac     638616 (0.06%)             
  __apple_types      27153903 (2.39%)        __apple_types      27153903 (2.40%)             
  __apple_objc             36 (0.00%)        __apple_objc             36 (0.00%)             
                                                                                             
   Total Size: 896384453  (79.04%)            Total Size: 892692214  (78.97%)                
   Total File Size: 1134157253                Total File Size: 1130465014                    
  ----------------------------------------------------                                       

I'll just put this behind an lldb tuning


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144181



More information about the cfe-commits mailing list