diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-07-23 18:18:25 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-07-23 18:34:59 +0200 |
commit | 77ae06b8c6c7425c0376dbd526390ba1f48b3db5 (patch) | |
tree | d6b86c1291eb04275a589d74c345588a2e52f1cb /llvm/lib/Support/OptimizedStructLayout.cpp | |
parent | 0edc13509920f43f4863c8ed1b23c34f6bbfcb7a (diff) | |
download | llvm-77ae06b8c6c7425c0376dbd526390ba1f48b3db5.zip llvm-77ae06b8c6c7425c0376dbd526390ba1f48b3db5.tar.gz llvm-77ae06b8c6c7425c0376dbd526390ba1f48b3db5.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Support/OptimizedStructLayout.cpp')
0 files changed, 0 insertions, 0 deletions