@@ -188,13 +188,11 @@ template <typename Callback> struct PluginInstance {
188188 PluginInstance (llvm::StringRef name, llvm::StringRef description,
189189 Callback create_callback,
190190 DebuggerInitializeCallback debugger_init_callback = nullptr )
191- : name(name), description(description), enabled(true ),
192- create_callback (create_callback),
191+ : name(name), description(description), create_callback(create_callback),
193192 debugger_init_callback (debugger_init_callback) {}
194193
195194 llvm::StringRef name;
196195 llvm::StringRef description;
197- bool enabled;
198196 Callback create_callback;
199197 DebuggerInitializeCallback debugger_init_callback;
200198};
@@ -252,9 +250,7 @@ template <typename Instance> class PluginInstances {
252250 }
253251
254252 void PerformDebuggerCallback (Debugger &debugger) {
255- for (const auto &instance : m_instances) {
256- if (!instance.enabled )
257- continue ;
253+ for (auto &instance : m_instances) {
258254 if (instance.debugger_init_callback )
259255 instance.debugger_init_callback (debugger);
260256 }
@@ -264,14 +260,7 @@ template <typename Instance> class PluginInstances {
264260 // Note that this is a copy of the internal state so modifications
265261 // to the returned instances will not be reflected back to instances
266262 // stored by the PluginInstances object.
267- std::vector<Instance> GetSnapshot () {
268- std::vector<Instance> enabled_instances;
269- for (const auto &instance : m_instances) {
270- if (instance.enabled )
271- enabled_instances.push_back (instance);
272- }
273- return enabled_instances;
274- }
263+ std::vector<Instance> GetSnapshot () { return m_instances; }
275264
276265 const Instance *GetInstanceAtIndex (uint32_t idx) {
277266 uint32_t count = 0 ;
@@ -291,41 +280,12 @@ template <typename Instance> class PluginInstances {
291280 const Instance *
292281 FindEnabledInstance (std::function<bool (const Instance &)> predicate) const {
293282 for (const auto &instance : m_instances) {
294- if (!instance.enabled )
295- continue ;
296283 if (predicate (instance))
297284 return &instance;
298285 }
299286 return nullptr ;
300287 }
301288
302- // Return a list of all the registered plugin instances. This includes both
303- // enabled and disabled instances. The instances are listed in the order they
304- // were registered which is the order they would be queried if they were all
305- // enabled.
306- std::vector<RegisteredPluginInfo> GetPluginInfoForAllInstances () {
307- // Lookup the plugin info for each instance in the sorted order.
308- std::vector<RegisteredPluginInfo> plugin_infos;
309- plugin_infos.reserve (m_instances.size ());
310- for (const Instance &instance : m_instances)
311- plugin_infos.push_back (
312- {instance.name , instance.description , instance.enabled });
313-
314- return plugin_infos;
315- }
316-
317- bool SetInstanceEnabled (llvm::StringRef name, bool enable) {
318- auto it = std::find_if (
319- m_instances.begin (), m_instances.end (),
320- [&](const Instance &instance) { return instance.name == name; });
321-
322- if (it == m_instances.end ())
323- return false ;
324-
325- it->enabled = enable;
326- return true ;
327- }
328-
329289private:
330290 std::vector<Instance> m_instances;
331291};
@@ -667,15 +627,6 @@ PluginManager::GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx) {
667627 return GetSystemRuntimeInstances ().GetCallbackAtIndex (idx);
668628}
669629
670- std::vector<RegisteredPluginInfo> PluginManager::GetSystemRuntimePluginInfo () {
671- return GetSystemRuntimeInstances ().GetPluginInfoForAllInstances ();
672- }
673-
674- bool PluginManager::SetSystemRuntimePluginEnabled (llvm::StringRef name,
675- bool enable) {
676- return GetSystemRuntimeInstances ().SetInstanceEnabled (name, enable);
677- }
678-
679630#pragma mark ObjectFile
680631
681632struct ObjectFileInstance : public PluginInstance <ObjectFileCreateInstance> {
0 commit comments