-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Document the @noescape
SIL function type attribute.
#15077
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
Conversation
docs/SIL.rst
Outdated
@@ -437,7 +437,13 @@ number of ways: | |||
a guaranteed direct parameter. | |||
|
|||
- Otherwise, the context value is treated as an unowned direct | |||
parameter. | |||
parameter. FIXME!!! what is this?? It sounds like ``@noescape |
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.
This predates @noescape
. @convention(block)
's context is passed unowned
From test/IRGen/objc_block.sil:
// CHECK-LABEL: define{{( protected)?}} swiftcc %T10objc_block3FooC* @call_block(%objc_block*, %T10objc_block3FooC*) {{.*}} {
// CHECK: entry:
// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, %objc_block* %0, i32 0, i32 3
// CHECK: [[T1:%.*]] = load i8*, i8** [[T0]]
// CHECK: [[T2:%.*]] = bitcast i8* [[T1]] to i8* (%objc_block*, i8*)*
// CHECK: [[T3:%.*]] = bitcast %T10objc_block3FooC* %1 to i8*
// CHECK: [[T4:%.*]] = call i8* [[T2]](%objc_block* %0, i8* [[T3]])
// CHECK: [[T5:%.*]] = bitcast i8* [[T4]] to %T10objc_block3FooC*
// CHECK: ret %T10objc_block3FooC* [[T5]]
// CHECK: }
@aschwaighofer is it fair to say that |
It only makes sense to have an ownership qualifier for the context on a function representation that has a context. Yes I think so. |
We can have:
|
@aschwaighofer here's another revision. I'll let you figure out how to kill off |
This looks good to me. |
@noescape
SIL function type attribute.@noescape
SIL function type attribute.
@swift-ci smoke test and merge. |
1 similar comment
@swift-ci smoke test and merge. |
No description provided.