diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2025-07-08 09:01:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-08 09:01:10 +0100 |
commit | fd997d86f060c8110a6b5151e8f21c4e4e17ba4a (patch) | |
tree | 4b1077bf9153c8eaefd3a255d87c190d11dfd5ac /lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | |
parent | 2e5776130b1da8d2d553b62a87c6bf6ace07e2f8 (diff) | |
download | llvm-fd997d86f060c8110a6b5151e8f21c4e4e17ba4a.zip llvm-fd997d86f060c8110a6b5151e8f21c4e4e17ba4a.tar.gz llvm-fd997d86f060c8110a6b5151e8f21c4e4e17ba4a.tar.bz2 |
[lldb][test] Combine libstdc++ and libc++ tuple tests into generic test (#147139)
This combines the libc++ and libstdc++ test cases. The main difference
was that the libstdcpp tests had some tuple indexing tests that libc++
didn't have.
The libstdc++ formatter didn't support size summaries for std::tuple. So
I added a `ContainerSizeSummaryProvider` for it (like we do for libc++).
Additionally, the synthetic frontend would only apply to non-empty
tuples, so I adjusted the regex to match empty ones too. We do this for
libc++ already.
Split out from https://github.com/llvm/llvm-project/pull/146740
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 06412e3..e64b3eb 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -1504,6 +1504,10 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "^std::((__debug::)?|(__cxx11::)?)list<.+>(( )?&)?$", stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, ContainerSizeSummaryProvider, + "libstdc++ std::tuple summary provider", + "^std::tuple<.*>(( )?&)?$", stl_summary_flags, true); + cpp_category_sp->AddTypeSummary( "^std::((__debug::)?|(__cxx11::)?)forward_list<.+>(( )?&)?$", eFormatterMatchRegex, @@ -1546,7 +1550,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { AddCXXSynthetic( cpp_category_sp, lldb_private::formatters::LibStdcppTupleSyntheticFrontEndCreator, - "std::tuple synthetic children", "^std::tuple<.+>(( )?&)?$", + "std::tuple synthetic children", "^std::tuple<.*>(( )?&)?$", stl_synth_flags, true); static constexpr const char *const libstdcpp_std_coroutine_handle_regex = |