[lldb][TypeSynthetic][NFC] Make SyntheticChildrenFrontend::Update() return an enum (#80167)

This patch changes the return value of
`SyntheticChildrenFrontend::Update` to a scoped enum that aims to
describe what the return value means.
This commit is contained in:
Michael Buch
2024-02-08 11:09:45 +00:00
committed by GitHub
parent 455c3966cd
commit d7fb94b6da
34 changed files with 321 additions and 271 deletions

View File

@@ -190,11 +190,13 @@ size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren(uint32_t max) {
return m_interpreter->CalculateNumChildren(m_wrapper_sp, max);
}
bool ScriptedSyntheticChildren::FrontEnd::Update() {
lldb::ChildCacheState ScriptedSyntheticChildren::FrontEnd::Update() {
if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return lldb::ChildCacheState::eRefetch;
return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);
return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp)
? lldb::ChildCacheState::eReuse
: lldb::ChildCacheState::eRefetch;
}
bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {

View File

@@ -245,7 +245,7 @@ public:
return child_sp;
}
bool Update() override {
lldb::ChildCacheState Update() override {
m_parent_format = m_backend.GetFormat();
CompilerType parent_type(m_backend.GetCompilerType());
CompilerType element_type;
@@ -258,7 +258,7 @@ public:
::CalculateNumChildren(element_type, num_elements, m_child_type)
.value_or(0);
m_item_format = GetItemFormatForFormat(m_parent_format, m_child_type);
return false;
return lldb::ChildCacheState::eRefetch;
}
bool MightHaveChildren() override { return true; }