-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AST] NFC: ExtInfo should reserve only needed TypeBase bits #13053
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
[AST] NFC: ExtInfo should reserve only needed TypeBase bits #13053
Conversation
Both AnyFunctionType and SILFunctionType reserve 16 bits in the TypeBase for their respective "ExtInfo" bits, but then these types use less than half of the bits they reserve. This patch changes AnyFunctionType and SILFunctionType to only reserve what they need and then verify at construction time that ExtInfo bits are not being truncated. This change is motivated by the need to have more TypeBase bits available for other uses. Finally, this change fixes a copy-and-paste error introduced when AnyFunctionType and SILFunctionType stopped sharing the same ExtInfo data structure.
@swift-ci please test |
Build failed |
Weird. A spurious build lock failure on Linux. Let's try again: @swift-ci please test linux |
Build failed |
@swift-ci please smoke test linux |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test Linux |
Could we introduce constants at the top of this file for the number of bits in these ExtInfo structures? I can't think of an obvious way to static_assert that the masks fit within that number of bits, but we could at least have comments explaining the dependency. |
Sure. Please consider reviewing #13079. |
Both AnyFunctionType and SILFunctionType reserve 16 bits in the TypeBase
for their respective "ExtInfo" bits, but then these types use less than
half of the bits they reserve. This patch changes AnyFunctionType and
SILFunctionType to only reserve what they need and then verify at
construction time that ExtInfo bits are not being truncated.
This change is motivated by the need to have more TypeBase bits
available for other uses.
Finally, this change fixes a copy-and-paste error introduced when
AnyFunctionType and SILFunctionType stopped sharing the same ExtInfo
data structure.