[Lldb-commits] [lldb] [lldb] Remove unused AnyMatches functions from DataFormatters (PR #208288)
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 8 11:47:12 PDT 2026
https://github.com/bulbazord created https://github.com/llvm/llvm-project/pull/208288
The only `AnyMatches` function actually used is in TypeCategoryImpl and TieredFormatterContainer.
>From fdbe07d1cd10589846ec1e8afe95a58d40da1e34 Mon Sep 17 00:00:00 2001
From: Alex Langford <alangford at apple.com>
Date: Wed, 8 Jul 2026 11:45:41 -0700
Subject: [PATCH] [lldb] Remove unused AnyMatches functions from DataFormatters
The only `AnyMatches` function actually used is in TypeCategoryImpl and
TieredFormatterContainer.
---
.../lldb/DataFormatters/DataVisualization.h | 7 -------
lldb/include/lldb/DataFormatters/FormatManager.h | 10 ----------
.../lldb/DataFormatters/TypeCategoryMap.h | 7 -------
lldb/source/DataFormatters/DataVisualization.cpp | 9 ---------
lldb/source/DataFormatters/TypeCategoryMap.cpp | 16 ----------------
5 files changed, 49 deletions(-)
diff --git a/lldb/include/lldb/DataFormatters/DataVisualization.h b/lldb/include/lldb/DataFormatters/DataVisualization.h
index 5aea29132b8fc..d02b378fe7e09 100644
--- a/lldb/include/lldb/DataFormatters/DataVisualization.h
+++ b/lldb/include/lldb/DataFormatters/DataVisualization.h
@@ -50,13 +50,6 @@ class DataVisualization {
static lldb::SyntheticChildrenSP
GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic);
- static bool
- AnyMatches(const FormattersMatchCandidate &candidate_type,
- TypeCategoryImpl::FormatCategoryItems items =
- TypeCategoryImpl::ALL_ITEM_TYPES,
- bool only_enabled = true, const char **matching_category = nullptr,
- TypeCategoryImpl::FormatCategoryItems *matching_type = nullptr);
-
class NamedSummaryFormats {
public:
static bool GetSummaryFormat(ConstString type,
diff --git a/lldb/include/lldb/DataFormatters/FormatManager.h b/lldb/include/lldb/DataFormatters/FormatManager.h
index 214723ce7687f..76c5d0caed7c4 100644
--- a/lldb/include/lldb/DataFormatters/FormatManager.h
+++ b/lldb/include/lldb/DataFormatters/FormatManager.h
@@ -120,16 +120,6 @@ class FormatManager : public IFormatChangeListener {
lldb::SyntheticChildrenSP
GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic);
- bool
- AnyMatches(const FormattersMatchCandidate &candidate_type,
- TypeCategoryImpl::FormatCategoryItems items =
- TypeCategoryImpl::ALL_ITEM_TYPES,
- bool only_enabled = true, const char **matching_category = nullptr,
- TypeCategoryImpl::FormatCategoryItems *matching_type = nullptr) {
- return m_categories_map.AnyMatches(candidate_type, items, only_enabled,
- matching_category, matching_type);
- }
-
static bool GetFormatFromCString(const char *format_cstr,
lldb::Format &format);
diff --git a/lldb/include/lldb/DataFormatters/TypeCategoryMap.h b/lldb/include/lldb/DataFormatters/TypeCategoryMap.h
index b1981233378bf..26ce0f28cc9dc 100644
--- a/lldb/include/lldb/DataFormatters/TypeCategoryMap.h
+++ b/lldb/include/lldb/DataFormatters/TypeCategoryMap.h
@@ -65,13 +65,6 @@ class TypeCategoryMap {
lldb::TypeCategoryImplSP GetAtIndex(uint32_t);
- bool
- AnyMatches(const FormattersMatchCandidate &candidate_type,
- TypeCategoryImpl::FormatCategoryItems items =
- TypeCategoryImpl::ALL_ITEM_TYPES,
- bool only_enabled = true, const char **matching_category = nullptr,
- TypeCategoryImpl::FormatCategoryItems *matching_type = nullptr);
-
uint32_t GetCount() { return m_map.size(); }
template <typename ImplSP> void Get(FormattersMatchData &, ImplSP &);
diff --git a/lldb/source/DataFormatters/DataVisualization.cpp b/lldb/source/DataFormatters/DataVisualization.cpp
index 036c9372baf81..60d715ce1928b 100644
--- a/lldb/source/DataFormatters/DataVisualization.cpp
+++ b/lldb/source/DataFormatters/DataVisualization.cpp
@@ -65,15 +65,6 @@ DataVisualization::GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp) {
return GetFormatManager().GetSyntheticForType(type_sp);
}
-bool DataVisualization::AnyMatches(
- const FormattersMatchCandidate &candidate_type,
- TypeCategoryImpl::FormatCategoryItems items, bool only_enabled,
- const char **matching_category,
- TypeCategoryImpl::FormatCategoryItems *matching_type) {
- return GetFormatManager().AnyMatches(candidate_type, items, only_enabled,
- matching_category, matching_type);
-}
-
bool DataVisualization::Categories::GetCategory(ConstString category,
lldb::TypeCategoryImplSP &entry,
bool allow_create) {
diff --git a/lldb/source/DataFormatters/TypeCategoryMap.cpp b/lldb/source/DataFormatters/TypeCategoryMap.cpp
index 9412dd3392d36..96971ec70ca19 100644
--- a/lldb/source/DataFormatters/TypeCategoryMap.cpp
+++ b/lldb/source/DataFormatters/TypeCategoryMap.cpp
@@ -158,22 +158,6 @@ bool TypeCategoryMap::Get(KeyType name, TypeCategoryImplSP &entry) {
return true;
}
-bool TypeCategoryMap::AnyMatches(
- const FormattersMatchCandidate &candidate_type,
- TypeCategoryImpl::FormatCategoryItems items, bool only_enabled,
- const char **matching_category,
- TypeCategoryImpl::FormatCategoryItems *matching_type) {
- std::lock_guard<std::recursive_mutex> guard(m_map_mutex);
-
- MapIterator pos, end = m_map.end();
- for (pos = m_map.begin(); pos != end; pos++) {
- if (pos->second->AnyMatches(candidate_type, items, only_enabled,
- matching_category, matching_type))
- return true;
- }
- return false;
-}
-
template <typename ImplSP>
void TypeCategoryMap::Get(FormattersMatchData &match_data, ImplSP &retval) {
std::lock_guard<std::recursive_mutex> guard(m_map_mutex);
More information about the lldb-commits
mailing list