Skip to content

Commit 3ff1e49

Browse files
committed
Use TypeRefBuilder::lookupSuperclass
1 parent da1254e commit 3ff1e49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,11 +1084,16 @@ SwiftLanguageRuntimeImpl::GetNumChildren(CompilerType type,
10841084
return {};
10851085

10861086
auto *reflection_ctx = GetReflectionContext();
1087-
auto tc = swift::reflection::TypeConverter(reflection_ctx->getBuilder());
1087+
auto &builder = reflection_ctx->getBuilder();
1088+
auto tc = swift::reflection::TypeConverter(builder);
10881089
LLDBTypeInfoProvider tip(*this, *ts);
10891090
auto *cti = tc.getClassInstanceTypeInfo(tr, 0, &tip);
10901091
if (auto *rti =
10911092
llvm::dyn_cast_or_null<swift::reflection::RecordTypeInfo>(cti)) {
1093+
// The superclass, if any, is an extra child.
1094+
if (builder.lookupSuperclass(tr)) {
1095+
return rti->getNumFields() + 1;
1096+
}
10921097
return rti->getNumFields();
10931098
}
10941099

0 commit comments

Comments
 (0)