forked from OSchip/llvm-project
Fix "help language", the languages printer was assuming the
eLanguageType numbers would be sequential, but vendor types are not and the printer went crazy. llvm-svn: 235153
This commit is contained in:
parent
a09bcd0632
commit
de50d36ab3
|
@ -91,6 +91,9 @@ public:
|
|||
static const char *
|
||||
GetNameForLanguageType (lldb::LanguageType language);
|
||||
|
||||
static void
|
||||
PrintAllLanguages (Stream &s, const char *prefix, const char *suffix);
|
||||
|
||||
static bool
|
||||
LanguageIsCPlusPlus (lldb::LanguageType language);
|
||||
|
||||
|
|
|
@ -850,12 +850,9 @@ LanguageTypeHelpTextCallback ()
|
|||
|
||||
StreamString sstr;
|
||||
sstr << "One of the following languages:\n";
|
||||
|
||||
for (unsigned int l = eLanguageTypeUnknown; l < eNumLanguageTypes; ++l)
|
||||
{
|
||||
sstr << " " << LanguageRuntime::GetNameForLanguageType(static_cast<LanguageType>(l)) << "\n";
|
||||
}
|
||||
|
||||
|
||||
LanguageRuntime::PrintAllLanguages(sstr, " ", "\n");
|
||||
|
||||
sstr.Flush();
|
||||
|
||||
std::string data = sstr.GetString();
|
||||
|
|
|
@ -369,6 +369,15 @@ LanguageRuntime::GetNameForLanguageType (LanguageType language)
|
|||
return language_names[eLanguageTypeUnknown].name;
|
||||
}
|
||||
|
||||
void
|
||||
LanguageRuntime::PrintAllLanguages (Stream &s, const char *prefix, const char *suffix)
|
||||
{
|
||||
for (uint32_t i = 1; i < num_languages; i++)
|
||||
{
|
||||
s.Printf("%s%s%s", prefix, language_names[i].name, suffix);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
LanguageRuntime::LanguageIsCPlusPlus (LanguageType language)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue