From e4e17b8ce46ab38802f3918de34db8a94dfed2c4 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Sat, 18 Mar 2017 17:33:00 +0000 Subject: [PATCH] Remove some dead code from DumpValueObjectOptions::PointerDepth llvm-svn: 298189 --- .../lldb/DataFormatters/DumpValueObjectOptions.h | 5 +---- lldb/source/DataFormatters/ValueObjectPrinter.cpp | 26 ++-------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h index b510a3c..00baea7 100644 --- a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h +++ b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h @@ -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 { diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index 0c6a3b6..173050b 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -468,32 +468,11 @@ bool ValueObjectPrinter::PrintObjectDescriptionIfNeeded(bool value_printed, 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(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::ShouldPrintChildren( 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()); -- 2.7.4