Skip to content

[Runtime] Skip metadata records search for classes in the __C module. #66109

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 1 commit into from
May 25, 2023

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented May 24, 2023

ObjC classes won't be found, so don't spend lots of time searching for them.

rdar://109783948

ObjC classes won't be found, so don't spend lots of time searching for them.

rdar://109783948
@mikeash mikeash requested a review from al45tair May 24, 2023 21:17
@al45tair
Copy link
Contributor

@swift-ci Please test

#if SWIFT_OBJC_INTEROP
// Classes in the __C module are ObjC classes. They never have a
// nominal type descriptor, so don't bother to search for one.
if (node && node->getKind() == Node::Kind::Class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have used && a bit more and had fewer if statements, but this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that we want a separate binding for child to make the later conditions more comprehensible, and the check for "does this node have a module name at all?" is conceptually different from "does the module name match the thing we're looking for?" But ultimately the (dis)organization of the code just matches that of the brain it came from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants