-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add @_inlineable attribute #5570
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
Add @_inlineable attribute #5570
Conversation
@swift-ci Please smoke test and merge |
@@ -164,9 +164,12 @@ SIMPLE_DECL_ATTR(nonobjc, NonObjC, | |||
SIMPLE_DECL_ATTR(_fixed_layout, FixedLayout, | |||
OnVar | OnClass | OnStruct | OnEnum | UserInaccessible, 31) | |||
|
|||
SIMPLE_DECL_ATTR(_fragile, Fragile, | |||
OnVar | OnSubscript | OnFunc | OnConstructor | UserInaccessible, 32) |
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.
You'll want to bump the module version...
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.
Good point.
Please name this Does this also belong on deinitializers? |
be78115
to
416aa2e
Compare
@DougGregor I bumped the version. @jrose-apple I renamed the attribute and added a test that it works on deinits -- good catch. |
@swift-ci Please test and merge |
It's also spelled |
Oh no it isn't. :-) http://jrose-apple.github.io/swift-library-evolution/#inlineable-functions (I went back and forth on it. I don't actually care what swift-evolution picks once we put this through review, which is probably the most dangerous thing to say.) |
Quiz: What does @_transparent on an extension actually *do*? 1) Make all members @_transparent? 2) Allow your members to be @_transparent? 3) Some other magical effect that has nothing to do with members? The correct answer is 1), however a few places in the stdlib defined a @_transparent extension and then proceeded to make some or all members also @_transparent, and in a couple of places we defined a @_transparent extension with no members at all. To avoid cargo culting and confusion, remove the ability to make @_transparent extensions altogether, and force usages to be explicit.
This attribute causes a function's body to be serialized, but unlike @_transparent and @inline(__always), does not force it to be inlined.
416aa2e
to
4780b0b
Compare
@swift-ci Please smoke test and merge |
1 similar comment
@swift-ci Please smoke test and merge |
@jckarter @jrose-apple One of the reasons I wanted to go with |
We may as well head off an unnecessary swift-evolution bikeshed by using the correct spelling going in, or else picking a name whose spelling is less in doubt like Slava suggested. |
No description provided.