mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[transferring] Add mangling support for transferring.
This includes runtime support for instantiating transferring param/result in function types. This is especially important since that is how we instantiate function types like: typealias Fn = (transferring X) -> (). rdar://123118061
This commit is contained in:
@@ -1379,11 +1379,12 @@ static llvm::Value *getFunctionParameterRef(IRGenFunction &IGF,
|
||||
/// Mapping type-level parameter flags to ABI parameter flags.
|
||||
ParameterFlags irgen::getABIParameterFlags(ParameterTypeFlags flags) {
|
||||
return ParameterFlags()
|
||||
.withValueOwnership(flags.getValueOwnership())
|
||||
.withVariadic(flags.isVariadic())
|
||||
.withAutoClosure(flags.isAutoClosure())
|
||||
.withNoDerivative(flags.isNoDerivative())
|
||||
.withIsolated(flags.isIsolated());
|
||||
.withValueOwnership(flags.getValueOwnership())
|
||||
.withVariadic(flags.isVariadic())
|
||||
.withAutoClosure(flags.isAutoClosure())
|
||||
.withNoDerivative(flags.isNoDerivative())
|
||||
.withIsolated(flags.isIsolated())
|
||||
.withTransferring(flags.isTransferring());
|
||||
}
|
||||
|
||||
static std::pair<FunctionTypeFlags, ExtendedFunctionTypeFlags>
|
||||
@@ -1416,8 +1417,9 @@ getFunctionTypeFlags(CanFunctionType type) {
|
||||
}
|
||||
|
||||
auto extFlags = ExtendedFunctionTypeFlags()
|
||||
.withTypedThrows(!type->getThrownError().isNull());
|
||||
|
||||
.withTypedThrows(!type->getThrownError().isNull())
|
||||
.withTransferringResult(type->hasTransferringResult());
|
||||
|
||||
auto flags = FunctionTypeFlags()
|
||||
.withConvention(metadataConvention)
|
||||
.withAsync(type->isAsync())
|
||||
|
||||
Reference in New Issue
Block a user