Remove TypeValidators (NFC in terms of the testsuite)

This is a half-implemented feature that as far as we can tell was
never used by anything since its original inclusion in 2014. This
patch removes it to make remaining the code easier to understand.

Differential Revision: https://reviews.llvm.org/D71310
This commit is contained in:
Adrian Prantl
2019-12-10 15:32:57 -08:00
parent 5a3a9e9927
commit ee64dfd953
26 changed files with 14 additions and 635 deletions

View File

@@ -17,7 +17,7 @@ using namespace lldb_private;
FormatCache::Entry::Entry()
: m_format_cached(false), m_summary_cached(false),
m_synthetic_cached(false), m_validator_cached(false) {}
m_synthetic_cached(false) {}
bool FormatCache::Entry::IsFormatCached() { return m_format_cached; }
@@ -25,8 +25,6 @@ bool FormatCache::Entry::IsSummaryCached() { return m_summary_cached; }
bool FormatCache::Entry::IsSyntheticCached() { return m_synthetic_cached; }
bool FormatCache::Entry::IsValidatorCached() { return m_validator_cached; }
void FormatCache::Entry::Get(lldb::TypeFormatImplSP &retval) {
retval = m_format_sp;
}
@@ -39,10 +37,6 @@ void FormatCache::Entry::Get(lldb::SyntheticChildrenSP &retval) {
retval = m_synthetic_sp;
}
void FormatCache::Entry::Get(lldb::TypeValidatorImplSP &retval) {
retval = m_validator_sp;
}
void FormatCache::Entry::Set(lldb::TypeFormatImplSP format_sp) {
m_format_cached = true;
m_format_sp = format_sp;
@@ -58,11 +52,6 @@ void FormatCache::Entry::Set(lldb::SyntheticChildrenSP synthetic_sp) {
m_synthetic_sp = synthetic_sp;
}
void FormatCache::Entry::Set(lldb::TypeValidatorImplSP validator_sp) {
m_validator_cached = true;
m_validator_sp = validator_sp;
}
FormatCache::FormatCache()
: m_map(), m_mutex()
#ifdef LLDB_CONFIGURATION_DEBUG
@@ -89,9 +78,6 @@ template<> bool FormatCache::Entry::IsCached<lldb::TypeSummaryImplSP> () {
template<> bool FormatCache::Entry::IsCached<lldb::SyntheticChildrenSP>() {
return IsSyntheticCached();
}
template<> bool FormatCache::Entry::IsCached<lldb::TypeValidatorImplSP>() {
return IsValidatorCached();
}
template <typename ImplSP>
bool FormatCache::Get(ConstString type, ImplSP &format_impl_sp) {
@@ -111,12 +97,9 @@ bool FormatCache::Get(ConstString type, ImplSP &format_impl_sp) {
return false;
}
/// Explicit instantiations for the four types.
/// Explicit instantiations for the three types.
/// \{
template bool
FormatCache::Get<lldb::TypeValidatorImplSP>(ConstString,
lldb::TypeValidatorImplSP &);
template bool
FormatCache::Get<lldb::TypeFormatImplSP>(ConstString, lldb::TypeFormatImplSP &);
template bool
FormatCache::Get<lldb::TypeSummaryImplSP>(ConstString,
@@ -142,12 +125,6 @@ void FormatCache::Set(ConstString type,
GetEntry(type).Set(synthetic_sp);
}
void FormatCache::Set(ConstString type,
lldb::TypeValidatorImplSP &validator_sp) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
GetEntry(type).Set(validator_sp);
}
void FormatCache::Clear() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
m_map.clear();