diff options
author | Enrico Granata <egranata@apple.com> | 2014-02-07 19:21:09 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2014-02-07 19:21:09 +0000 |
commit | 1d736c31d63bf58835050209666b2702d0c86235 (patch) | |
tree | e0600fe5d3e14e376f3b9d7f2cbfa3975ae3d77d /lldb/source/DataFormatters | |
parent | 66f273be345562fa0ebe275f1ef8c5c621c69f1d (diff) | |
download | bcm5719-llvm-1d736c31d63bf58835050209666b2702d0c86235.tar.gz bcm5719-llvm-1d736c31d63bf58835050209666b2702d0c86235.zip |
rdar://15648942
Provide a filter for libc++ std::atomic<T>
This just hides some implementation clutter and promotes the actual content to only child status
llvm-svn: 200984
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 2526472af67..751e6128461 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -821,6 +821,24 @@ static void AddCXXSynthetic (TypeCategoryImpl::SharedPointer category_sp, } #endif +#ifndef LLDB_DISABLE_PYTHON +static void AddFilter (TypeCategoryImpl::SharedPointer category_sp, + std::vector<std::string> children, + const char* description, + ConstString type_name, + ScriptedSyntheticChildren::Flags flags, + bool regex = false) +{ + TypeFilterImplSP filter_sp(new TypeFilterImpl(flags)); + for (auto child : children) + filter_sp->AddExpressionPath(child); + if (regex) + category_sp->GetRegexTypeFiltersContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())), filter_sp); + else + category_sp->GetTypeFiltersContainer()->Add(type_name,filter_sp); +} +#endif + void FormatManager::LoadLibStdcppFormatters() { @@ -971,6 +989,7 @@ FormatManager::LoadLibcxxFormatters() AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEndCreator, "std::map iterator synthetic children", ConstString("^std::__1::__map_iterator<.+>$"), stl_synth_flags, true); + AddFilter(libcxx_category_sp, {"__a_"}, "libc++ std::atomic filter", ConstString("^std::__1::atomic<.*>$"), stl_synth_flags, true); #endif } |