-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SIL: Remove special meaning for @_semantics("stdlib_binary_only") #12237
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,26 @@ | |
@_silgen_name("unknown") | ||
public func unknown() -> () | ||
|
||
@_inlineable | ||
public func doSomething() { | ||
unknown() | ||
} | ||
|
||
@_semantics("stdlib_binary_only") | ||
public func doSomething2() { | ||
unknown() | ||
} | ||
|
||
@inline(never) | ||
@_semantics("stdlib_binary_only") | ||
public func doSomething3<T>(_ a:T) { | ||
unknown() | ||
} | ||
|
||
struct A {} | ||
@_versioned struct A { | ||
@_versioned init() {} | ||
} | ||
|
||
@inline(never) | ||
@_inlineable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, I thought There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But, @swiftix told me that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @moiseev IIRC, the current rules in the compiler work in such a way that @slavapestov That's how it works today, or? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @swiftix and @milseman are correct. I know it's a bit confusing but this is where we are at today:
|
||
public func callDoSomething3() { | ||
doSomething3(A()) | ||
} |
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.
IIRC The comment is solely from the lack of
@_inlineable
. I don't think it goes on@inline(never)
, but I don't know where to put it. Perhaps under the new paradigm it's just not an interesting distinction. Thoughts?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 think the comment is still useful for future maintainers in case they decide to put @_inlineable back in?
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.
In theory we shouldn't need the inline-never anymore either, right?
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.
Without inline-never it can be inlined inside the stdlib itself.
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.
Right, but that should be fine now.
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.
Outline-and-inline-never is still a useful, albeit niche, tool inside the stdlib when Builtin.expect is insufficient.