[Lldb-commits] [lldb] 5c15426 - [lldb] Remove FormattersContainer's name member

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 21 04:54:59 PDT 2020


Author: Raphael Isemann
Date: 2020-07-21T13:54:38+02:00
New Revision: 5c15426d7c62aa8c38547144f28c5a1c6e50549a

URL: https://github.com/llvm/llvm-project/commit/5c15426d7c62aa8c38547144f28c5a1c6e50549a
DIFF: https://github.com/llvm/llvm-project/commit/5c15426d7c62aa8c38547144f28c5a1c6e50549a.diff

LOG: [lldb] Remove FormattersContainer's name member

Summary:

FormattersContainer currently has an unused `m_name` member. Usually LLDB allows
giving objects names, but for the FormattersContainer it seems excessive. There
are only 4 FormattersContainer variables in LLDB and they are not usually passed
around, so one can always just go up a few frames when debugging to find out
which FormattersContainer you're dealing with.

Reviewers: mib, davide

Reviewed By: mib

Subscribers: JDevlieghere

Differential Revision: https://reviews.llvm.org/D84154

Added: 
    

Modified: 
    lldb/include/lldb/DataFormatters/FormattersContainer.h
    lldb/include/lldb/DataFormatters/TypeCategory.h
    lldb/source/DataFormatters/TypeCategory.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/DataFormatters/FormattersContainer.h b/lldb/include/lldb/DataFormatters/FormattersContainer.h
index 2b9c1dcc334f..a22cf494bf8a 100644
--- a/lldb/include/lldb/DataFormatters/FormattersContainer.h
+++ b/lldb/include/lldb/DataFormatters/FormattersContainer.h
@@ -169,8 +169,7 @@ template <typename KeyType, typename ValueType> class FormattersContainer {
 
   friend class TypeCategoryImpl;
 
-  FormattersContainer(std::string name, IFormatChangeListener *lst)
-      : m_format_map(lst), m_name(name) {}
+  FormattersContainer(IFormatChangeListener *lst) : m_format_map(lst) {}
 
   void Add(MapKeyType type, const MapValueType &entry) {
     Add_Impl(std::move(type), entry, static_cast<KeyType *>(nullptr));
@@ -205,7 +204,6 @@ template <typename KeyType, typename ValueType> class FormattersContainer {
 
 protected:
   BackEndType m_format_map;
-  std::string m_name;
 
   FormattersContainer(const FormattersContainer &) = delete;
   const FormattersContainer &operator=(const FormattersContainer &) = delete;

diff  --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h
index 820872a59bda..11614fc67cd2 100644
--- a/lldb/include/lldb/DataFormatters/TypeCategory.h
+++ b/lldb/include/lldb/DataFormatters/TypeCategory.h
@@ -42,10 +42,9 @@ template <typename FormatterImpl> class FormatterContainerPair {
   typedef
       typename RegexMatchContainer::ForEachCallback RegexMatchForEachCallback;
 
-  FormatterContainerPair(const char *exact_name, const char *regex_name,
-                         IFormatChangeListener *clist)
-      : m_exact_sp(new ExactMatchContainer(std::string(exact_name), clist)),
-        m_regex_sp(new RegexMatchContainer(std::string(regex_name), clist)) {}
+  FormatterContainerPair(IFormatChangeListener *clist)
+      : m_exact_sp(new ExactMatchContainer(clist)),
+        m_regex_sp(new RegexMatchContainer(clist)) {}
 
   ~FormatterContainerPair() = default;
 

diff  --git a/lldb/source/DataFormatters/TypeCategory.cpp b/lldb/source/DataFormatters/TypeCategory.cpp
index 8368c91a57f1..f1c6210edd1a 100644
--- a/lldb/source/DataFormatters/TypeCategory.cpp
+++ b/lldb/source/DataFormatters/TypeCategory.cpp
@@ -15,11 +15,9 @@ using namespace lldb_private;
 
 TypeCategoryImpl::TypeCategoryImpl(IFormatChangeListener *clist,
                                    ConstString name)
-    : m_format_cont("format", "regex-format", clist),
-      m_summary_cont("summary", "regex-summary", clist),
-      m_filter_cont("filter", "regex-filter", clist),
-      m_synth_cont("synth", "regex-synth", clist), m_enabled(false),
-      m_change_listener(clist), m_mutex(), m_name(name), m_languages() {}
+    : m_format_cont(clist), m_summary_cont(clist), m_filter_cont(clist),
+      m_synth_cont(clist), m_enabled(false), m_change_listener(clist),
+      m_mutex(), m_name(name), m_languages() {}
 
 static bool IsApplicable(lldb::LanguageType category_lang,
                          lldb::LanguageType valobj_lang) {


        


More information about the lldb-commits mailing list