[Lldb-commits] [lldb] bc69dd2 - [FormatManager] GetCandidateLanguages shouldn't know about ValueObject.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 9 17:16:28 PST 2019
Author: Davide Italiano
Date: 2019-12-09T17:16:20-08:00
New Revision: bc69dd2cfae37a335b9a0125e161c54548a9d2a5
URL: https://github.com/llvm/llvm-project/commit/bc69dd2cfae37a335b9a0125e161c54548a9d2a5
DIFF: https://github.com/llvm/llvm-project/commit/bc69dd2cfae37a335b9a0125e161c54548a9d2a5.diff
LOG: [FormatManager] GetCandidateLanguages shouldn't know about ValueObject.
Reviewers: jingham, teemperor, JDevlieghere, aprantl
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71236
Added:
Modified:
lldb/include/lldb/DataFormatters/FormatManager.h
lldb/source/DataFormatters/FormatClasses.cpp
lldb/source/DataFormatters/FormatManager.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/DataFormatters/FormatManager.h b/lldb/include/lldb/DataFormatters/FormatManager.h
index 66df8397dfee..54877284c57b 100644
--- a/lldb/include/lldb/DataFormatters/FormatManager.h
+++ b/lldb/include/lldb/DataFormatters/FormatManager.h
@@ -189,9 +189,6 @@ class FormatManager : public IFormatChangeListener {
GetCandidateLanguages(lldb::LanguageType lang_type);
private:
- static std::vector<lldb::LanguageType>
- GetCandidateLanguages(ValueObject &valobj);
-
static void GetPossibleMatches(ValueObject &valobj,
CompilerType compiler_type, uint32_t reason,
lldb::DynamicValueType use_dynamic,
diff --git a/lldb/source/DataFormatters/FormatClasses.cpp b/lldb/source/DataFormatters/FormatClasses.cpp
index 271963b5f8f4..6a9279f54d64 100644
--- a/lldb/source/DataFormatters/FormatClasses.cpp
+++ b/lldb/source/DataFormatters/FormatClasses.cpp
@@ -24,7 +24,8 @@ FormattersMatchData::FormattersMatchData(ValueObject &valobj,
m_formatters_match_vector({}, false), m_type_for_cache(),
m_candidate_languages() {
m_type_for_cache = FormatManager::GetTypeForCache(valobj, use_dynamic);
- m_candidate_languages = FormatManager::GetCandidateLanguages(valobj);
+ m_candidate_languages =
+ FormatManager::GetCandidateLanguages(valobj.GetObjectRuntimeLanguage());
}
FormattersMatchVector FormattersMatchData::GetMatchesVector() {
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 33aa2dc7a3a1..8ae9bcc1c1cd 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -238,7 +238,8 @@ void FormatManager::GetPossibleMatches(
}
}
- for (lldb::LanguageType language_type : GetCandidateLanguages(valobj)) {
+ for (lldb::LanguageType language_type :
+ GetCandidateLanguages(valobj.GetObjectRuntimeLanguage())) {
if (Language *language = Language::FindPlugin(language_type)) {
for (ConstString candidate :
language->GetPossibleFormattersMatches(valobj, use_dynamic)) {
@@ -579,8 +580,7 @@ ConstString FormatManager::GetTypeForCache(ValueObject &valobj,
}
std::vector<lldb::LanguageType>
-FormatManager::GetCandidateLanguages(ValueObject &valobj) {
- lldb::LanguageType lang_type = valobj.GetObjectRuntimeLanguage();
+FormatManager::GetCandidateLanguages(lldb::LanguageType lang_type) {
switch (lang_type) {
case lldb::eLanguageTypeC:
case lldb::eLanguageTypeC89:
More information about the lldb-commits
mailing list