Skip to content

[TypeChecker] NFC: Unify logic in checkDeclarationAvailaibility and… #35343

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
Jan 11, 2021

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jan 11, 2021

ConstraintSystem::isDeclUnavailable

@xedin xedin requested a review from slavapestov January 11, 2021 08:09
})) {
auto &Context = Where.getDeclContext()->getASTContext();
AvailabilityContext safeRangeUnderApprox{
AvailabilityInference::availableRange(D, Context)};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slavapestov Is AvailabilityInference::availableRange(D, Context) an expensive operation? I could try and make sure that it's done only once is so.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it should be pretty cheap. I'll re-run my benchmark with your change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know how it goes then and I'll merge these changes if everything is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can go ahead and merge it first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, 🚀

@xedin
Copy link
Contributor Author

xedin commented Jan 11, 2021

@swift-ci please smoke test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Thank you for doing this, I totally forgot about it!

})) {
auto &Context = Where.getDeclContext()->getASTContext();
AvailabilityContext safeRangeUnderApprox{
AvailabilityInference::availableRange(D, Context)};
Copy link
Contributor

Choose a reason for hiding this comment

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

No, it should be pretty cheap. I'll re-run my benchmark with your change.

@xedin
Copy link
Contributor Author

xedin commented Jan 11, 2021

@swift-ci please smoke test Windows platform

@xedin xedin merged commit bede9c8 into swiftlang:main Jan 11, 2021
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