mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add the @_unsafeNonEscapableResult function
This will allow NonEscapable types to be returned from a function.
This commit is contained in:
@@ -197,6 +197,10 @@ void SILFunctionBuilder::addFunctionAttributes(
|
||||
F->setForceEnableLexicalLifetimes(DoForceEnableLexicalLifetimes);
|
||||
}
|
||||
|
||||
if (Attrs.hasAttribute<UnsafeNonEscapableResultAttr>()) {
|
||||
F->setHasUnsafeNonEscapableResult(true);
|
||||
}
|
||||
|
||||
// Validate `@differentiable` attributes by calling `getParameterIndices`.
|
||||
// This is important for:
|
||||
// - Skipping invalid `@differentiable` attributes in non-primary files.
|
||||
|
||||
Reference in New Issue
Block a user