summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/PluginManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/PluginManager.cpp')
-rw-r--r--lldb/source/Core/PluginManager.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 67744da4a81..b7b6b9a54ef 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -1355,19 +1355,20 @@ PluginManager::GetPlatformCreateCallbackForPluginName(const ConstString &name) {
return nullptr;
}
-size_t PluginManager::AutoCompletePlatformName(const char *name,
+size_t PluginManager::AutoCompletePlatformName(llvm::StringRef name,
StringList &matches) {
- if (name) {
- std::lock_guard<std::recursive_mutex> guard(GetPlatformInstancesMutex());
- PlatformInstances &instances = GetPlatformInstances();
- llvm::StringRef name_sref(name);
+ if (name.empty())
+ return matches.GetSize();
- PlatformInstances::iterator pos, end = instances.end();
- for (pos = instances.begin(); pos != end; ++pos) {
- llvm::StringRef plugin_name(pos->name.GetCString());
- if (plugin_name.startswith(name_sref))
- matches.AppendString(plugin_name.data());
- }
+ std::lock_guard<std::recursive_mutex> guard(GetPlatformInstancesMutex());
+ PlatformInstances &instances = GetPlatformInstances();
+ llvm::StringRef name_sref(name);
+
+ PlatformInstances::iterator pos, end = instances.end();
+ for (pos = instances.begin(); pos != end; ++pos) {
+ llvm::StringRef plugin_name(pos->name.GetCString());
+ if (plugin_name.startswith(name_sref))
+ matches.AppendString(plugin_name.data());
}
return matches.GetSize();
}
OpenPOWER on IntegriCloud