[all-commits] [llvm/llvm-project] 81a537: [lldb] Use range-based for loops over plugins (#18...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Mar 6 14:48:56 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 81a537e7081b76d41aa0422924d334a713fdd779
      https://github.com/llvm/llvm-project/commit/81a537e7081b76d41aa0422924d334a713fdd779
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2026-03-06 (Fri, 06 Mar 2026)

  Changed paths:
    M lldb/include/lldb/Core/PluginManager.h
    M lldb/source/Commands/CommandObjectThread.cpp
    M lldb/source/Core/Disassembler.cpp
    M lldb/source/Core/DynamicLoader.cpp
    M lldb/source/Core/EmulateInstruction.cpp
    M lldb/source/Core/Highlighter.cpp
    M lldb/source/Core/PluginManager.cpp
    M lldb/source/Expression/REPL.cpp
    M lldb/source/Symbol/ObjectContainer.cpp
    M lldb/source/Symbol/ObjectFile.cpp
    M lldb/source/Symbol/SymbolFile.cpp
    M lldb/source/Symbol/SymbolVendor.cpp
    M lldb/source/Symbol/TypeSystem.cpp
    M lldb/source/Target/ABI.cpp
    M lldb/source/Target/InstrumentationRuntime.cpp
    M lldb/source/Target/JITLoader.cpp
    M lldb/source/Target/Language.cpp
    M lldb/source/Target/LanguageRuntime.cpp
    M lldb/source/Target/MemoryHistory.cpp
    M lldb/source/Target/OperatingSystem.cpp
    M lldb/source/Target/Platform.cpp
    M lldb/source/Target/Process.cpp
    M lldb/source/Target/SyntheticFrameProvider.cpp
    M lldb/source/Target/SystemRuntime.cpp
    M lldb/source/Target/UnwindAssembly.cpp
    M lldb/unittests/Core/PluginManagerTest.cpp

  Log Message:
  -----------
  [lldb] Use range-based for loops over plugins (#184837)

This PR replaces the Get*CallbackAtIndex pattern in the PluginManager
with returning a snapshot of callbacks that the caller can iterate over
using a range-based for loop. This is a continuation of #184452 which
added thread safety by using snapshots. However, that introduced a bunch
of unnecessary copies which are largely eliminated again by getting the
snapshot once when gather all the callbacks, rather than doing that on
each iteration when querying a plugin for a given index. It also
eliminates the possibility of the snapshot changing underneath you when
iterating over the plugins.

This change was largely mechanical and I used Claude to do the menial
work of updating the signatures and call sites.



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