[Lldb-commits] [lldb] bbcdcea - [TypeCategory] IsApplicable gets a LanguageType, not a ValueObject.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 10 14:59:43 PST 2019
Author: Davide Italiano
Date: 2019-12-10T14:59:34-08:00
New Revision: bbcdcea4bf8423041108e22dc619f7d5fdae9870
URL: https://github.com/llvm/llvm-project/commit/bbcdcea4bf8423041108e22dc619f7d5fdae9870
DIFF: https://github.com/llvm/llvm-project/commit/bbcdcea4bf8423041108e22dc619f7d5fdae9870.diff
LOG: [TypeCategory] IsApplicable gets a LanguageType, not a ValueObject.
Reviewers: aprantl, teemperor
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71305
Added:
Modified:
lldb/include/lldb/DataFormatters/TypeCategory.h
lldb/source/DataFormatters/TypeCategory.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h
index dc5edb654940..f37c661d56d0 100644
--- a/lldb/include/lldb/DataFormatters/TypeCategory.h
+++ b/lldb/include/lldb/DataFormatters/TypeCategory.h
@@ -391,7 +391,7 @@ class TypeCategoryImpl {
void Disable() { Enable(false, UINT32_MAX); }
- bool IsApplicable(ValueObject &valobj);
+ bool IsApplicable(lldb::LanguageType lang);
uint32_t GetLastEnabledPosition() { return m_enabled_position; }
diff --git a/lldb/source/DataFormatters/TypeCategory.cpp b/lldb/source/DataFormatters/TypeCategory.cpp
index be3b31603eac..4f8ea5d43411 100644
--- a/lldb/source/DataFormatters/TypeCategory.cpp
+++ b/lldb/source/DataFormatters/TypeCategory.cpp
@@ -60,11 +60,10 @@ static bool IsApplicable(lldb::LanguageType category_lang,
}
}
-bool TypeCategoryImpl::IsApplicable(ValueObject &valobj) {
- lldb::LanguageType valobj_lang = valobj.GetObjectRuntimeLanguage();
+bool TypeCategoryImpl::IsApplicable(lldb::LanguageType lang) {
for (size_t idx = 0; idx < GetNumLanguages(); idx++) {
const lldb::LanguageType category_lang = GetLanguageAtIndex(idx);
- if (::IsApplicable(category_lang, valobj_lang))
+ if (::IsApplicable(category_lang, lang))
return true;
}
return false;
@@ -89,7 +88,7 @@ void TypeCategoryImpl::AddLanguage(lldb::LanguageType lang) {
bool TypeCategoryImpl::Get(ValueObject &valobj,
const FormattersMatchVector &candidates,
lldb::TypeFormatImplSP &entry, uint32_t *reason) {
- if (!IsEnabled() || !IsApplicable(valobj))
+ if (!IsEnabled() || !IsApplicable(valobj.GetObjectRuntimeLanguage()))
return false;
if (GetTypeFormatsContainer()->Get(candidates, entry, reason))
return true;
@@ -102,7 +101,7 @@ bool TypeCategoryImpl::Get(ValueObject &valobj,
bool TypeCategoryImpl::Get(ValueObject &valobj,
const FormattersMatchVector &candidates,
lldb::TypeSummaryImplSP &entry, uint32_t *reason) {
- if (!IsEnabled() || !IsApplicable(valobj))
+ if (!IsEnabled() || !IsApplicable(valobj.GetObjectRuntimeLanguage()))
return false;
if (GetTypeSummariesContainer()->Get(candidates, entry, reason))
return true;
@@ -115,7 +114,7 @@ bool TypeCategoryImpl::Get(ValueObject &valobj,
bool TypeCategoryImpl::Get(ValueObject &valobj,
const FormattersMatchVector &candidates,
lldb::SyntheticChildrenSP &entry, uint32_t *reason) {
- if (!IsEnabled() || !IsApplicable(valobj))
+ if (!IsEnabled() || !IsApplicable(valobj.GetObjectRuntimeLanguage()))
return false;
TypeFilterImpl::SharedPointer filter_sp;
uint32_t reason_filter = 0;
More information about the lldb-commits
mailing list