Skip to content

Commit 9e41188

Browse files
committed
use fallback for any failed data dependency
1 parent 3331e29 commit 9e41188

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,22 +2071,17 @@ TypeSystemSwiftTypeRef::GetNumChildren(opaque_compiler_type_t type,
20712071
bool omit_empty_base_classes,
20722072
const ExecutionContext *exe_ctx) {
20732073
auto impl = [&]() -> uint32_t {
2074-
if (!exe_ctx)
2075-
return 0;
2076-
20772074
// TODO: which of these should be logged on failure?
2078-
if (auto *exe_scope = exe_ctx->GetBestExecutionContextScope())
2079-
if (auto *runtime =
2080-
SwiftLanguageRuntime::Get(exe_scope->CalculateProcess())) {
2081-
if (auto num_children =
2082-
runtime->GetNumChildren(GetCanonicalType(type), nullptr))
2083-
return *num_children;
2084-
else
2085-
return m_swift_ast_context->GetNumChildren(
2086-
ReconstructType(type), omit_empty_base_classes, exe_ctx);
2087-
}
2088-
2089-
return 0;
2075+
if (exe_ctx)
2076+
if (auto *exe_scope = exe_ctx->GetBestExecutionContextScope())
2077+
if (auto *runtime =
2078+
SwiftLanguageRuntime::Get(exe_scope->CalculateProcess()))
2079+
if (auto num_children =
2080+
runtime->GetNumChildren(GetCanonicalType(type), nullptr))
2081+
return *num_children;
2082+
2083+
return m_swift_ast_context->GetNumChildren(
2084+
ReconstructType(type), omit_empty_base_classes, exe_ctx);
20902085
};
20912086
VALIDATE_AND_RETURN(
20922087
impl, GetNumChildren, type,

0 commit comments

Comments
 (0)