[NFCI] More TypeCategoryImpl refactoring.
authorJorge Gorbe Moya <jgorbe@google.com>
Thu, 22 Sep 2022 18:00:22 +0000 (11:00 -0700)
committerJorge Gorbe Moya <jgorbe@google.com>
Mon, 10 Oct 2022 22:14:55 +0000 (15:14 -0700)
commite5fd507f9b6f774c83c7b061fa77c906c882935b
tree786b7ebceecced53d50bc55ca8c5f8f1ecda3922
parent7a3c9a85c5fa614ba43b013fce3445fe1f8fdd3f
[NFCI] More TypeCategoryImpl refactoring.

The main aim of this patch is to delete the remaining instances of code
reaching into the internals of `TypeCategoryImpl`. I made the following
changes:

- Add some more methods to `TieredFormatterContainer` and
  `TypeCategoryImpl` to expose functionality that is implemented in
  `FormattersContainer`.

- Add new overloads of `TypeCategoryImpl::AddTypeXXX` to make it easier
  to add formatters to categories without reaching into the internal
  `FormattersContainer` objects.

- Remove the `GetTypeXXXContainer` and `GetRegexTypeXXXContainer`
  accessors from `TypeCategoryImpl` and update all call sites to use the
  new methods instead.

Differential Revision: https://reviews.llvm.org/D135399
lldb/include/lldb/DataFormatters/TypeCategory.h
lldb/source/Commands/CommandObjectType.cpp
lldb/source/DataFormatters/FormatManager.cpp
lldb/source/DataFormatters/FormattersHelpers.cpp
lldb/source/DataFormatters/TypeCategory.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp