diff options
author | Enrico Granata <egranata@apple.com> | 2015-07-07 00:20:57 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-07-07 00:20:57 +0000 |
commit | d529d04fd73c55f35d3f6425314a6780e9146f23 (patch) | |
tree | c1bc3b8509a1dde0e927d7afa53f5dccd5beaea5 /lldb/source/DataFormatters/FormatManager.cpp | |
parent | 5a2acd1e1ebaef6fac73b81554284ba5e7ac1ac6 (diff) | |
download | llvm-d529d04fd73c55f35d3f6425314a6780e9146f23.zip llvm-d529d04fd73c55f35d3f6425314a6780e9146f23.tar.gz llvm-d529d04fd73c55f35d3f6425314a6780e9146f23.tar.bz2 |
Add a summary for vector types
The summary is - quite simply - a one-line printout of the vector elements
We still need synthetic children:
a) as a source of the elements to print in the summary
b) for graphical IDEs that display structure regardless of the summary settings
rdar://5429347
llvm-svn: 241531
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
-rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 47456ba..4e0fffb 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -1608,6 +1608,26 @@ FormatManager::LoadHardcodedFormatters() } return nullptr; }); + m_hardcoded_summaries.push_back( + [](lldb_private::ValueObject& valobj, + lldb::DynamicValueType, + FormatManager& fmt_mgr) -> TypeSummaryImpl::SharedPointer { + static CXXFunctionSummaryFormat::SharedPointer formatter_sp(new CXXFunctionSummaryFormat(TypeSummaryImpl::Flags() + .SetCascades(true) + .SetDontShowChildren(true) + .SetHideItemNames(true) + .SetShowMembersOneLiner(true) + .SetSkipPointers(true) + .SetSkipReferences(false), + lldb_private::formatters::VectorTypeSummaryProvider, + "vector_type pointer summary provider")); + if (valobj.GetClangType().IsVectorType(nullptr, nullptr)) + { + if (fmt_mgr.GetCategory(fmt_mgr.m_vectortypes_category_name)->IsEnabled()) + return formatter_sp; + } + return nullptr; + }); } { // insert code to load synthetics here |