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
This commit is contained in:
Enrico Granata 2014-02-07 19:21:09 +00:00
parent 66f273be34
commit 1d736c31d6
1 changed files with 19 additions and 0 deletions

View File

@ -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
}