-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implementation-only import checking for types used in decls #23722
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
|
33500ef
to
72b9218
Compare
@swift-ci Please test compiler performance |
It's a bit surprising to see more AST context memory allocated... |
I should probably try a dummy PR that makes everything slow to make sure the bot is really working. I trust it to catch drastic slowdowns but everything else is kind of fuzzy. |
/// to the given callback. | ||
/// | ||
/// If the callback returns \c false, aborts the traversal. | ||
class TypeDeclFinder : public ASTWalker, public TypeWalker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to fold the TypeRepr walking and the Type walking into one helper class, but that seems increasingly shortsighted. I'm going to undo this.
72b9218
to
e873ef5
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
Source compat failures are unrelated to this PR (but are concerning). |
...for planned reuse in implementation-only import logic. No intended functionality change.
I wish there was more we could share with the upcoming implementation-only checker, but I don't see an obvious way to do it. All the call sites want to know what kind of declaration they're visiting in order to customize the diagnostic, or downgrade something to a warning, or something else. No functionality change.
Based on the existing access checker for types used in decls. There's a common skeleton here but we can't seem to get it out, so for now add a third DeclVisitor to this file. On the plus side, checking this alongside access is an easy way to make sure everything gets checked. Part of rdar://problem/48991061
...which I had exactly backwards.
e873ef5
to
4972351
Compare
@swift-ci Please test |
@brentdax and @slavapestov reviewed this as part of #23808 already. |
Build failed |
Build failed |
Implementation-only import checking for types used in decls (cherry picked from commit be48d64)
This broke the windows build: https://dev.azure.com/compnerd/windows-swift/_build/results?buildId=1077
|
Builds on John's #23702 to handle checking of types in decls, the same way we do for access control. Contains more duplicated code than I like, but appears to work, and may provide refactoring hints in the future.
Part of rdar://problem/48991061