Files
clang-p2996/lldb/source/Core/PluginManager.cpp
David Peixotto f0b3bdd6df [lldb] Remove raw access to PluginInstances vector (#132884)
Remove raw access to PluginInstances vector

This commit modifies the PluginInstances class to remove direct access
to the m_instances vector. Instead, we expose a new `GetSnapshot` method
that returns a copy of the current state of the instances vector.  All
external iteration over the instances is updated to use the new method.

The motivation for the change is to allow modifying the way we store
instances without having to change all the clients. This is a
preliminary change to allow enabling/disabling of plugins in which case
we want to iterate over only enabled plugins.

We also considered using a custom iterator that wraps the vector
iterator and can skip over disabled instances. That works, but the
iterator code is a bit messy with all template and typedefs to make a
compliant iterator.
2025-03-31 09:53:46 -07:00

70 KiB