Skip to content

ClangImporter: Don't force loading of all superclass members in loadNamedMembers() #29348

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

Conversation

slavapestov
Copy link
Contributor

I had to fix a fake module.map in IRGen to avoid some breakage.

…amedMembers()

I had to fix a fake module.map in IRGen to avoid some breakage.

for (auto *ED : const_cast<ClassDecl *>(CD)->getExtensions())
ED->loadAllMembers();
auto &ctx = CD->getASTContext();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this can actually be replaced with a call to (void) CD->lookupDirect(name). I'm going to test and benchmark both versions before checking this in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it is.

@slavapestov slavapestov requested a review from CodaFi January 22, 2020 03:05
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

if (ED->hasClangNode() && ED->hasLazyMembers()) {
auto ci = ctx.getOrCreateLazyIterableContextData(
ED, /*lazyLoader=*/nullptr);
if (true || !ci->loader->loadNamedMembers(ED, name, ci->memberData))
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat debugging trick, but we oughta get these out before this is merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, that wasn't supposed to be in there. It works without the 'true ||' too.

@slavapestov
Copy link
Contributor Author

#26975 supersedes this PR.

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