llvm-project/lldb/source/DataFormatters
Raphael Isemann 77ae06b8c6 [lldb][NFC] Remove FormatMap
Summary:

FormattersContainer.h has two containers: FormatMap and FormattersContainer
itself. FormatMap is essentially just a SetVector with a listener interface that
is aspiring to be thread-safe as most of its functions lock its member mutex.

FormattersContainer is for the most part just calling the matching functions of
internal FormatMap instance and essentially acts as a wrapper class with some
minor formatter search functionality on top. The only difference is that the
FormattersContainer's public `Get` function is actually searching formatters in
the list of formatters (and for example doing regex-matching) while FormatMap's
`Get` function is just looking up a a format by the type matcher string.

This patch deletes `FormatMap` by just renaming it to `FormattersContainer` and
pulling in the two `Get` functions from the original `FormattersContainer`
class.

The only other user of `FormatMap` was the `NamedSummariesMap` in the
`FormatManager` which I migrated by just making it also a `FormattersContainer`
and replaced the only call to the `Get` function (which now has new semantics)
with `GetExact` (which is FormattersContainer's function that has the semantics
of FormatMap's `Get`). As `NamedSummariesMap` only stores non-regex-based
formatters, both `Get` and `GetExact` would have worked, so this was mostly to
clarify that this is supposed to be NFC.

I also added the missing mutex lock in the `GetCount` function which was
previously missing in the `FormatMap` implementation. Technically not "NFC" but
I anyway had to change the function...

Reviewers: labath, mib

Reviewed By: labath

Subscribers: abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D84296
2020-07-23 18:34:59 +02:00
..
CMakeLists.txt Remove TypeValidators (NFC in terms of the testsuite) 2019-12-11 09:27:12 -08:00
CXXFunctionPointer.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DataVisualization.cpp [lldb][NFC] Remove FormatMap 2020-07-23 18:34:59 +02:00
DumpValueObjectOptions.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatCache.cpp [lldb][NFC] Always update m_cache_{hits/misses} in FormatCache 2020-03-24 20:16:43 +01:00
FormatClasses.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatManager.cpp Reland [lldb] Unify type name matching in FormattersContainer II 2020-07-23 18:17:42 +02:00
FormattersHelpers.cpp [DataFormatters] Add formatter for libc++ std::unique_ptr 2020-03-23 11:48:20 -07:00
LanguageCategory.cpp [LLDB] Fix compilation with GCC 5 2020-02-06 10:16:32 +02:00
StringPrinter.cpp [lldb/StringPrinter] Support strings with invalid utf8 sub-sequences 2020-06-03 12:24:23 -07:00
TypeCategory.cpp [lldb] Remove FormattersContainer's name member 2020-07-21 13:54:38 +02:00
TypeCategoryMap.cpp [lldb][NFC] Remove FormatterChoiceCriterion 2020-04-15 09:47:15 +02:00
TypeFormat.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeSummary.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeSynthetic.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ValueObjectPrinter.cpp [lldb] Small improvements in ValueObjectPrinter::PrintDecl (NFC) 2020-06-12 21:05:05 -07:00
VectorType.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00