[all-commits] [llvm/llvm-project] 74d487: update ManualDWARFIndex::Index to use std::once (#...

Tom Yang via All-commits all-commits at lists.llvm.org
Fri Oct 31 15:09:00 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 74d4870aa503e90a614e4bc725d670abc5f90218
      https://github.com/llvm/llvm-project/commit/74d4870aa503e90a614e4bc725d670abc5f90218
  Author: Tom Yang <zhenyutyang at gmail.com>
  Date:   2025-10-31 (Fri, 31 Oct 2025)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h

  Log Message:
  -----------
  update ManualDWARFIndex::Index to use std::once (#165896)

Small change to use (what I think is) a better practice -- we were using
the `m_indexed` bool member to make sure we called `Index()` once, but
we should just use `std::once`! This change shouldn't affect
functionality.

This change may also make concurrent access to `Index()` thread-safe,
though the ManualDWARFIndex API isn't completely thread-safe due to
`Decode()`. I'm not sure if ManualDWARFIndex was ever intended to be
thread-safe.

Test Plan:

`ninja check-lldb`

Tested basic debugging workflow of a couple of large projects I had
built. Basically:
```
(lldb) target create <project>
(lldb) b main
(lldb) r
(lldb) step
... 
```

I A/B tested the performance of launching several modules with parallel
module loading and didn't observe any performance regressions.

---------

Co-authored-by: Tom Yang <toyang 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