Added support for enumerating the languages that actually support TypeSystems
and expressions.  Also wired that into the OptionValue infrastructure, although
it isn't used for tab-completion yet.

llvm-svn: 249769
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 7bf4348..4b32074 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -2531,6 +2531,7 @@
     ConstString name;
     std::string description;
     TypeSystemCreateInstance create_callback;
+    TypeSystemEnumerateSupportedLanguages enumerate_callback;
 };
 
 typedef std::vector<TypeSystemInstance> TypeSystemInstances;
@@ -2552,7 +2553,8 @@
 bool
 PluginManager::RegisterPlugin (const ConstString &name,
                                const char *description,
-                               TypeSystemCreateInstance create_callback)
+                               TypeSystemCreateInstance create_callback,
+                               TypeSystemEnumerateSupportedLanguages enumerate_supported_languages_callback)
 {
     if (create_callback)
     {
@@ -2617,6 +2619,33 @@
     return NULL;
 }
 
+TypeSystemEnumerateSupportedLanguages
+PluginManager::GetTypeSystemEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx)
+{
+    Mutex::Locker locker (GetTypeSystemMutex ());
+    TypeSystemInstances &instances = GetTypeSystemInstances ();
+    if (idx < instances.size())
+        return instances[idx].enumerate_callback;
+    return NULL;
+}
+
+TypeSystemEnumerateSupportedLanguages
+PluginManager::GetTypeSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name)
+{
+    if (name)
+    {
+        Mutex::Locker locker (GetTypeSystemMutex ());
+        TypeSystemInstances &instances = GetTypeSystemInstances ();
+        
+        TypeSystemInstances::iterator pos, end = instances.end();
+        for (pos = instances.begin(); pos != end; ++ pos)
+        {
+            if (name == pos->name)
+                return pos->enumerate_callback;
+        }
+    }
+    return NULL;
+}
 
 #pragma mark PluginManager