mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Change GetNumChildren()/CalculateNumChildren() methods return llvm::Expected (#84219)
Change GetNumChildren()/CalculateNumChildren() methods return llvm::Expected This is an NFC change that does not yet add any error handling or change any code to return any errors. This is the second big change in the patch series started with https://github.com/llvm/llvm-project/pull/83501 A follow-up PR will wire up error handling.
This commit is contained in:
@@ -126,17 +126,21 @@ ConstString ValueObjectMemory::GetDisplayTypeName() {
|
||||
return m_compiler_type.GetDisplayTypeName();
|
||||
}
|
||||
|
||||
uint32_t ValueObjectMemory::CalculateNumChildren(uint32_t max) {
|
||||
llvm::Expected<uint32_t> ValueObjectMemory::CalculateNumChildren(uint32_t max) {
|
||||
if (m_type_sp) {
|
||||
auto child_count = m_type_sp->GetNumChildren(true);
|
||||
return child_count <= max ? child_count : max;
|
||||
if (!child_count)
|
||||
return child_count;
|
||||
return *child_count <= max ? *child_count : max;
|
||||
}
|
||||
|
||||
ExecutionContext exe_ctx(GetExecutionContextRef());
|
||||
const bool omit_empty_base_classes = true;
|
||||
auto child_count =
|
||||
m_compiler_type.GetNumChildren(omit_empty_base_classes, &exe_ctx);
|
||||
return child_count <= max ? child_count : max;
|
||||
if (!child_count)
|
||||
return child_count;
|
||||
return *child_count <= max ? *child_count : max;
|
||||
}
|
||||
|
||||
std::optional<uint64_t> ValueObjectMemory::GetByteSize() {
|
||||
|
||||
Reference in New Issue
Block a user