summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/ValueObject.cpp24
-rw-r--r--lldb/source/Core/ValueObjectSyntheticFilter.cpp8
2 files changed, 32 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index b5b55c9e24b..41c7dbe94fd 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -597,6 +597,30 @@ ValueObject::GetNumChildren ()
}
return m_children.GetChildrenCount();
}
+
+bool
+ValueObject::MightHaveChildren()
+{
+ bool has_children;
+ clang_type_t clang_type = GetClangType();
+ if (clang_type)
+ {
+ const uint32_t type_info = ClangASTContext::GetTypeInfo (clang_type,
+ GetClangAST(),
+ NULL);
+ if (type_info & (ClangASTContext::eTypeHasChildren |
+ ClangASTContext::eTypeIsPointer |
+ ClangASTContext::eTypeIsReference))
+ has_children = true;
+ }
+ else
+ {
+ has_children = GetNumChildren () > 0;
+ }
+ return has_children;
+}
+
+// Should only be called by ValueObject::GetNumChildren()
void
ValueObject::SetNumChildren (uint32_t num_children)
{
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index 284515ab592..fe8e90cf181 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -96,6 +96,14 @@ ValueObjectSynthetic::CalculateNumChildren()
return (m_synthetic_children_count = m_synth_filter_ap->CalculateNumChildren());
}
+bool
+ValueObjectSynthetic::MightHaveChildren()
+{
+ // TODO: make this more efficient by adding API calls to calculate this efficiently
+ return GetNumChildren () > 0;
+}
+
+
clang::ASTContext *
ValueObjectSynthetic::GetClangASTImpl ()
{
OpenPOWER on IntegriCloud