Refactoring of Get() methods in FormatManager/FormatCategory to have explicative names and return shared-pointers instead of bools
Reduced the amount of memory required to avoid loops in DumpPrintableRepresentation() from 32 bits down to 1 bit
- Additionally, disallowed creating summary strings of the form ${var%S} which did nothing but cause endless loops by definition
llvm-svn: 139201
diff --git a/lldb/source/Core/DataVisualization.cpp b/lldb/source/Core/DataVisualization.cpp
index 7c326ed..3b310eb 100644
--- a/lldb/source/Core/DataVisualization.cpp
+++ b/lldb/source/Core/DataVisualization.cpp
@@ -38,10 +38,12 @@
return GetFormatManager().GetCurrentRevision();
}
-bool
-DataVisualization::ValueFormats::Get (ValueObject& valobj, lldb::DynamicValueType use_dynamic, lldb::ValueFormatSP &entry)
+lldb::ValueFormatSP
+DataVisualization::ValueFormats::Get (ValueObject& valobj, lldb::DynamicValueType use_dynamic)
{
- return GetFormatManager().GetValueNavigator().Get(valobj,entry, use_dynamic);
+ lldb::ValueFormatSP entry;
+ GetFormatManager().GetValueNavigator().Get(valobj, entry, use_dynamic);
+ return entry;
}
void
@@ -74,19 +76,18 @@
return GetFormatManager().GetValueNavigator().GetCount();
}
-bool
+lldb::SummaryFormatSP
DataVisualization::GetSummaryFormat (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- lldb::SummaryFormatSP& entry)
+ lldb::DynamicValueType use_dynamic)
{
- return GetFormatManager().Get(valobj, entry, use_dynamic);
+ return GetFormatManager().GetSummaryFormat(valobj, use_dynamic);
}
-bool
+
+lldb::SyntheticChildrenSP
DataVisualization::GetSyntheticChildren (ValueObject& valobj,
- lldb::DynamicValueType use_dynamic,
- lldb::SyntheticChildrenSP& entry)
+ lldb::DynamicValueType use_dynamic)
{
- return GetFormatManager().Get(valobj, entry, use_dynamic);
+ return GetFormatManager().GetSyntheticChildren(valobj, use_dynamic);
}
bool