[all-commits] [llvm/llvm-project] cb04d3: Improve namespace lookup using .debug_names parent...

jeffreytan81 via All-commits all-commits at lists.llvm.org
Tue Oct 29 20:43:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb04d3378096b83e5e357490ff8b1c479f34c469
      https://github.com/llvm/llvm-project/commit/cb04d3378096b83e5e357490ff8b1c479f34c469
  Author: jeffreytan81 <jeffreytan at meta.com>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
    M lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

  Log Message:
  -----------
  Improve namespace lookup using .debug_names parent chain (#110062)

## Summary
This PR is a continuation of
https://github.com/llvm/llvm-project/pull/108907 by using `.debug_names`
parent chain faster lookup for namespaces.


## Implementation
Similar to https://github.com/llvm/llvm-project/pull/108907. This PR
adds a new API: `GetNamespacesWithParents` in `DWARFIndex` base class.
The API performs the same function as `GetNamespaces()` with additional
filtering using parents `CompilerDeclContext`. A default implementation
is given in `DWARFIndex` class which parses debug info and performs the
matching. In the `DebugNameDWARFIndex` override, parents
`CompilerDeclContext` is cross checked with parent chain in
`.debug_names` for much faster filtering before fallback to base
implementation for final filtering.

## Performance Results
For the same benchmark used in
https://github.com/llvm/llvm-project/pull/108907, this PR improves: 48s
=> 28s

---------

Co-authored-by: jeffreytan81 <jeffreytan at fb.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list