Skip to content

[RemoteInspection] Add TypeInfoProvider to ReflectionContext function #73713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions include/swift/RemoteInspection/ReflectionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,9 @@ class ReflectionContext
/// the superclass's fields. For a version of this function that performs the
/// same job but starting out with an instance pointer check
/// MetadataReader::readInstanceStartFromClassMetadata.
std::optional<unsigned> computeUnalignedFieldStartOffset(const TypeRef *TR) {
std::optional<unsigned>
computeUnalignedFieldStartOffset(const TypeRef *TR,
remote::TypeInfoProvider *ExternalTypeInfo) {
size_t isaAndRetainCountSize = sizeof(StoredSize) + sizeof(long long);

const TypeRef *superclass = getBuilder().lookupSuperclass(TR);
Expand All @@ -1286,12 +1288,12 @@ class ReflectionContext
return isaAndRetainCountSize;

auto superclassStart =
computeUnalignedFieldStartOffset(superclass);
computeUnalignedFieldStartOffset(superclass, ExternalTypeInfo);
if (!superclassStart)
return std::nullopt;

auto *superTI = getBuilder().getTypeConverter().getClassInstanceTypeInfo(
superclass, *superclassStart, nullptr);
superclass, *superclassStart, ExternalTypeInfo);
if (!superTI)
return std::nullopt;

Expand Down