Skip to content

ClangImporter: Reconcile Clang declaration hidden-ness between loadAllMembers() and lazy loading #29418

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

Conversation

slavapestov
Copy link
Contributor

Lazy loading checked if the ClangDecl was hidden, but loading all
members did not. Let's make loadAllMembers() behave like the lazy
path, and fix some of the mock SDKs in the test suite.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@@ -8670,7 +8670,8 @@ void ClangImporter::Implementation::collectMembersToAdd(
for (const clang::Decl *m : objcContainer->decls()) {
auto nd = dyn_cast<clang::NamedDecl>(m);
if (nd && nd == nd->getCanonicalDecl() &&
nd->getDeclContext() == objcContainer)
nd->getDeclContext() == objcContainer &&
isVisibleClangEntry(nd))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DougGregor This is the relevant part of the change...

Copy link
Member

Choose a reason for hiding this comment

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

Ah, looks totally reasonable!

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7bc8d75f2a7cb3b7fabf56f449e6ee4d126474ef

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7bc8d75f2a7cb3b7fabf56f449e6ee4d126474ef

@slavapestov slavapestov force-pushed the lazy-member-loading-inconsistency branch from 7bc8d75 to b6a488f Compare January 24, 2020 13:32
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7bc8d75f2a7cb3b7fabf56f449e6ee4d126474ef

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7bc8d75f2a7cb3b7fabf56f449e6ee4d126474ef

…lMembers() and lazy loading

Lazy loading checked if the ClangDecl was hidden, but loading all
members did not. Let's make loadAllMembers() behave like the lazy
path, and fix some of the mock SDKs in the test suite.
@slavapestov slavapestov force-pushed the lazy-member-loading-inconsistency branch from b6a488f to 305620b Compare January 24, 2020 22:07
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 8a7c970 into swiftlang:master Jan 25, 2020
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.

3 participants