Skip to content

Setup code for Clang types in SIL. #33541

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

varungandhi-apple
Copy link
Contributor

While working on rebasing #33085, I realized that the changes are just too much for one PR. So this is a separate PR breaking out the first two commits + some cleanup.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

5 similar comments
@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple varungandhi-apple force-pushed the vg-clang-types-in-sil-setup branch from 4b629f7 to 520db9f Compare August 22, 2020 18:44
@varungandhi-apple
Copy link
Contributor Author

Rebased on top of master to unblock later PR.

@swift-ci please smoke test

DifferentiabilityKind diffKind) {
return ((unsigned)rep) | (isPseudogeneric ? PseudogenericMask : 0) |
(isNoEscape ? NoEscapeMask : 0) |
(((unsigned)diffKind << DifferentiabilityMaskOffset) &
Copy link
Contributor

Choose a reason for hiding this comment

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

Assert that diffKind fits inside DifferentiabilityMask?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, should we do this consistently for all the fields? For example, representation takes two bits. I imagine we could have a Last = 3 case there (and a Last = 2 case for DifferentiabilityKind) and then have a static_assert(std::bit_width(DifferentiabilityKind::Last) == std::bit_width(DifferentiabilityMask)).

Copy link
Contributor Author

@varungandhi-apple varungandhi-apple Aug 28, 2020

Choose a reason for hiding this comment

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

(Leaving this open for discussion. Will fix this in a follow-up PR based on what you think about the question ^.)

@varungandhi-apple varungandhi-apple force-pushed the vg-clang-types-in-sil-setup branch from 520db9f to d70182e Compare August 24, 2020 22:09
@varungandhi-apple

This comment has been minimized.

This translation is a pre-requisite to storing Clang types in SILFunctionType.
@varungandhi-apple varungandhi-apple force-pushed the vg-clang-types-in-sil-setup branch from d70182e to 3f39e8a Compare August 26, 2020 22:39
@varungandhi-apple

This comment has been minimized.

@varungandhi-apple varungandhi-apple force-pushed the vg-clang-types-in-sil-setup branch from 3f39e8a to f11ddd6 Compare August 27, 2020 02:04
@varungandhi-apple

This comment has been minimized.

1 similar comment
@varungandhi-apple

This comment has been minimized.

@varungandhi-apple varungandhi-apple force-pushed the vg-clang-types-in-sil-setup branch from f11ddd6 to c4ad840 Compare August 27, 2020 20:14
@varungandhi-apple

This comment has been minimized.

@varungandhi-apple

This comment has been minimized.

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@varungandhi-apple
Copy link
Contributor Author

Random failures on macOS and Linux. 😠

@swift-ci please clean test

@varungandhi-apple varungandhi-apple merged commit 8df8315 into swiftlang:master Aug 28, 2020
@varungandhi-apple varungandhi-apple deleted the vg-clang-types-in-sil-setup branch August 28, 2020 21:34
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