Allow summary formatters to take ValueObjects into account when deciding whether values/children should be printed and if child names should be shown

This decision has always been statically-bound to the individual formatter. With this patch, the idea is that this decision could potentially be dynamic depending on the ValueObject itself

llvm-svn: 207046
This commit is contained in:
Enrico Granata
2014-04-23 23:16:25 +00:00
parent a10e240377
commit 8a068e6c43
4 changed files with 22 additions and 22 deletions

View File

@@ -341,7 +341,7 @@ ValueObjectPrinter::PrintValueAndSummaryIfNeeded (bool& value_printed,
// the value if this thing is nil
// (but show the value if the user passes a format explicitly)
TypeSummaryImpl* entry = GetSummaryFormatter();
if (!IsNil() && !m_value.empty() && (entry == NULL || (entry->DoesPrintValue() || options.m_format != eFormatDefault) || m_summary.empty()) && !options.m_hide_value)
if (!IsNil() && !m_value.empty() && (entry == NULL || (entry->DoesPrintValue(m_valobj) || options.m_format != eFormatDefault) || m_summary.empty()) && !options.m_hide_value)
{
m_stream->Printf(" %s", m_value.c_str());
value_printed = true;
@@ -426,7 +426,7 @@ ValueObjectPrinter::ShouldPrintChildren (bool is_failed_description,
TypeSummaryImpl* entry = GetSummaryFormatter();
return (!entry || entry->DoesPrintChildren() || m_summary.empty());
return (!entry || entry->DoesPrintChildren(m_valobj) || m_summary.empty());
}
return false;
}