@@ -89,31 +89,6 @@ class PluginListCommandOptions : public Options {
8989 bool m_exact_name_match = false ;
9090};
9191
92- // Define some data structures to describe known plugin "namespaces".
93- // The PluginManager is organized into a series of static functions
94- // that operate on different types of plugin. For example SystemRuntime
95- // and ObjectFile plugins.
96- //
97- // The namespace name is used a prefix when matching plugin names. For example,
98- // if we have an "elf" plugin in the "object-file" namespace then we will
99- // match a plugin name pattern against the "object-file.elf" name.
100- //
101- // The plugin namespace here is used so we can operate on all the plugins
102- // of a given type so it is easy to enable or disable them as a group.
103- using GetPluginInfo = std::function<std::vector<RegisteredPluginInfo>()>;
104- using SetPluginEnabled = std::function<bool (llvm::StringRef, bool )>;
105- struct PluginNamespace {
106- llvm::StringRef name;
107- GetPluginInfo get_info;
108- SetPluginEnabled set_enabled;
109- };
110-
111- // Currently supported set of plugin namespaces. This will be expanded
112- // over time.
113- PluginNamespace PluginNamespaces[] = {
114- {" system-runtime" , PluginManager::GetSystemRuntimePluginInfo,
115- PluginManager::SetSystemRuntimePluginEnabled}};
116-
11792// Helper function to perform an action on each matching plugin.
11893// The action callback is given the containing namespace along with plugin info
11994// for each matching plugin.
@@ -124,7 +99,8 @@ static int ActOnMatchingPlugins(
12499 action) {
125100 int num_matching = 0 ;
126101
127- for (const PluginNamespace &plugin_namespace : PluginNamespaces) {
102+ for (const PluginNamespace &plugin_namespace :
103+ PluginManager::GetPluginNamespaces ()) {
128104 std::vector<RegisteredPluginInfo> matching_plugins;
129105 for (const RegisteredPluginInfo &plugin_info :
130106 plugin_namespace.get_info ()) {
0 commit comments