[Lldb-commits] [lldb] r298189 - Remove some dead code from DumpValueObjectOptions::PointerDepth

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Sat Mar 18 10:33:00 PDT 2017


Author: tberghammer
Date: Sat Mar 18 12:33:00 2017
New Revision: 298189

URL: http://llvm.org/viewvc/llvm-project?rev=298189&view=rev
Log:
Remove some dead code from DumpValueObjectOptions::PointerDepth

Modified:
    lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h
    lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp

Modified: lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h?rev=298189&r1=298188&r2=298189&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h Sat Mar 18 12:33:00 2017
@@ -27,7 +27,7 @@ namespace lldb_private {
 class DumpValueObjectOptions {
 public:
   struct PointerDepth {
-    enum class Mode { Always, Formatters, Default, Never } m_mode;
+    enum class Mode { Always, Default, Never } m_mode;
     uint32_t m_count;
 
     PointerDepth operator--() const {
@@ -37,9 +37,6 @@ public:
     }
 
     bool CanAllowExpansion() const;
-
-    bool CanAllowExpansion(bool is_root, TypeSummaryImpl *entry,
-                           ValueObject *valobj, const std::string &summary);
   };
 
   struct PointerAsArraySettings {

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=298189&r1=298188&r2=298189&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Sat Mar 18 12:33:00 2017
@@ -468,32 +468,11 @@ bool ValueObjectPrinter::PrintObjectDesc
   return true;
 }
 
-bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion(
-    bool is_root, TypeSummaryImpl *entry, ValueObject *valobj,
-    const std::string &summary) {
-  switch (m_mode) {
-  case Mode::Always:
-    return (m_count > 0);
-  case Mode::Never:
-    return false;
-  case Mode::Default:
-    if (is_root)
-      m_count = std::min<decltype(m_count)>(m_count, 1);
-    return m_count > 0;
-  case Mode::Formatters:
-    if (!entry || entry->DoesPrintChildren(valobj) || summary.empty())
-      return m_count > 0;
-    return false;
-  }
-  return false;
-}
-
 bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion() const {
   switch (m_mode) {
   case Mode::Always:
   case Mode::Default:
-  case Mode::Formatters:
-    return (m_count > 0);
+    return m_count > 0;
   case Mode::Never:
     return false;
   }
@@ -546,8 +525,7 @@ bool ValueObjectPrinter::ShouldPrintChil
         return true;
       }
 
-      return curr_ptr_depth.CanAllowExpansion(false, entry, m_valobj,
-                                              m_summary);
+      return curr_ptr_depth.CanAllowExpansion();
     }
 
     return (!entry || entry->DoesPrintChildren(m_valobj) || m_summary.empty());




More information about the lldb-commits mailing list