Simplify the PrintableRepresentationSpecialCases code; we never used the ePrintableRepresentationSpecialCasesOnly value and with enum classes the names doesn't need to be that long

llvm-svn: 286176
This commit is contained in:
Enrico Granata 2016-11-07 23:32:20 +00:00
parent 583a307e17
commit 65d86e4fa5
7 changed files with 15 additions and 16 deletions

View File

@ -536,10 +536,9 @@ public:
ValueObjectRepresentationStyle val_obj_display,
lldb::Format custom_format);
enum PrintableRepresentationSpecialCases {
ePrintableRepresentationSpecialCasesDisable = 0,
ePrintableRepresentationSpecialCasesAllow = 1,
ePrintableRepresentationSpecialCasesOnly = 3
enum class PrintableRepresentationSpecialCases : bool {
eDisable = false,
eAllow = true
};
bool
@ -548,7 +547,7 @@ public:
eValueObjectRepresentationStyleSummary,
lldb::Format custom_format = lldb::eFormatInvalid,
PrintableRepresentationSpecialCases special =
ePrintableRepresentationSpecialCasesAllow,
PrintableRepresentationSpecialCases::eAllow,
bool do_dump_error = true);
bool GetValueIsValid() const;

View File

@ -874,7 +874,7 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
{
target->DumpPrintableRepresentation(
s, val_obj_display, custom_format,
ValueObject::ePrintableRepresentationSpecialCasesDisable);
ValueObject::PrintableRepresentationSpecialCases::eDisable);
}
return true;
}
@ -1676,8 +1676,7 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
ss, ValueObject::ValueObjectRepresentationStyle::
eValueObjectRepresentationStyleSummary,
eFormatDefault,
ValueObject::PrintableRepresentationSpecialCases::
ePrintableRepresentationSpecialCasesAllow,
ValueObject::PrintableRepresentationSpecialCases::eAllow,
false);
}

View File

@ -1279,10 +1279,9 @@ bool ValueObject::DumpPrintableRepresentation(
Flags flags(GetTypeInfo());
bool allow_special = ((special & ePrintableRepresentationSpecialCasesAllow) ==
ePrintableRepresentationSpecialCasesAllow);
bool only_special = ((special & ePrintableRepresentationSpecialCasesOnly) ==
ePrintableRepresentationSpecialCasesOnly);
bool allow_special =
(special == ValueObject::PrintableRepresentationSpecialCases::eAllow);
const bool only_special = false;
if (allow_special) {
if (flags.AnySet(eTypeIsArray | eTypeIsPointer) &&

View File

@ -762,7 +762,7 @@ bool ValueObjectPrinter::PrintChildrenOneLiner(bool hide_names) {
child_sp->DumpPrintableRepresentation(
*m_stream, ValueObject::eValueObjectRepresentationStyleSummary,
m_options.m_format,
ValueObject::ePrintableRepresentationSpecialCasesDisable);
ValueObject::PrintableRepresentationSpecialCases::eDisable);
}
}

View File

@ -59,7 +59,8 @@ bool lldb_private::formatters::LibcxxSmartPointerSummaryProvider(
if (pointee_sp->DumpPrintableRepresentation(
stream, ValueObject::eValueObjectRepresentationStyleSummary,
lldb::eFormatInvalid,
ValueObject::ePrintableRepresentationSpecialCasesDisable, false))
ValueObject::PrintableRepresentationSpecialCases::eDisable,
false))
print_pointee = true;
}
if (!print_pointee)

View File

@ -420,7 +420,8 @@ bool lldb_private::formatters::LibStdcppSmartPointerSummaryProvider(
if (pointee_sp->DumpPrintableRepresentation(
stream, ValueObject::eValueObjectRepresentationStyleSummary,
lldb::eFormatInvalid,
ValueObject::ePrintableRepresentationSpecialCasesDisable, false)) {
ValueObject::PrintableRepresentationSpecialCases::eDisable,
false)) {
return true;
}
}

View File

@ -135,7 +135,7 @@ bool LibStdcppUniquePtrSyntheticFrontEnd::GetSummary(
if (m_obj_obj->DumpPrintableRepresentation(
stream, ValueObject::eValueObjectRepresentationStyleSummary,
lldb::eFormatInvalid,
ValueObject::ePrintableRepresentationSpecialCasesDisable,
ValueObject::PrintableRepresentationSpecialCases::eDisable,
false)) {
print_pointee = true;
}