OSDN Git Service

[lldb] Remove FormattersContainer's name member
authorRaphael Isemann <teemperor@gmail.com>
Tue, 21 Jul 2020 11:00:17 +0000 (13:00 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 21 Jul 2020 11:54:38 +0000 (13:54 +0200)
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

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

index 2b9c1dc..a22cf49 100644 (file)
@@ -169,8 +169,7 @@ public:
 
   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 @@ public:
 
 protected:
   BackEndType m_format_map;
-  std::string m_name;
 
   FormattersContainer(const FormattersContainer &) = delete;
   const FormattersContainer &operator=(const FormattersContainer &) = delete;
index 820872a..11614fc 100644 (file)
@@ -42,10 +42,9 @@ public:
   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;
 
index 8368c91..f1c6210 100644 (file)
@@ -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) {