Use exact equality for category language matching, for all languages, except those specifically mentioned.

llvm-svn: 304832
This commit is contained in:
Vadim Chugunov 2017-06-06 20:40:24 +00:00
parent f16a45ea15
commit 98e3e6003d
1 changed files with 3 additions and 18 deletions

View File

@ -36,23 +36,8 @@ TypeCategoryImpl::TypeCategoryImpl(
static bool IsApplicable(lldb::LanguageType category_lang,
lldb::LanguageType valobj_lang) {
switch (category_lang) {
// these are not languages that LLDB would ordinarily deal with
// only allow an exact equality here, since we really don't know
// any better
case eLanguageTypeAda83:
case eLanguageTypeCobol74:
case eLanguageTypeCobol85:
case eLanguageTypeFortran77:
case eLanguageTypeFortran90:
case eLanguageTypePascal83:
case eLanguageTypeModula2:
case eLanguageTypeJava:
case eLanguageTypeAda95:
case eLanguageTypeFortran95:
case eLanguageTypePLI:
case eLanguageTypeUPC:
case eLanguageTypeD:
case eLanguageTypePython:
// Unless we know better, allow only exact equality.
default:
return category_lang == valobj_lang;
// the C family, we consider it as one
@ -80,7 +65,7 @@ static bool IsApplicable(lldb::LanguageType category_lang,
valobj_lang == eLanguageTypeC_plus_plus ||
valobj_lang == eLanguageTypeObjC;
default:
// Categories with unspecified language match everything.
case eLanguageTypeUnknown:
return true;
}