mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Async CC] Put direct returns after indirect returns.
For callers who do not know the actual type of the called function, e.g. when the called function is the result of a partial apply, the offset to the direct returns would otherwise not be known.
This commit is contained in:
@@ -121,6 +121,17 @@ AsyncContextLayout irgen::getAsyncContextLayout(
|
||||
indirectReturnInfos.push_back(indirectResult);
|
||||
}
|
||||
|
||||
// ResultTypes directResults...;
|
||||
auto directResults = fnConv.getDirectSILResults();
|
||||
for (auto result : directResults) {
|
||||
auto ty =
|
||||
fnConv.getSILType(result, IGF.IGM.getMaximalTypeExpansionContext());
|
||||
auto &ti = IGF.getTypeInfoForLowered(ty.getASTType());
|
||||
valTypes.push_back(ty);
|
||||
typeInfos.push_back(&ti);
|
||||
directReturnInfos.push_back(result);
|
||||
}
|
||||
|
||||
// SelfType self?;
|
||||
bool hasLocalContextParameter = hasSelfContextParameter(substitutedType);
|
||||
bool canHaveValidError = substitutedType->hasErrorResult();
|
||||
@@ -203,17 +214,6 @@ AsyncContextLayout irgen::getAsyncContextLayout(
|
||||
trailingWitnessInfo = AsyncContextLayout::TrailingWitnessInfo();
|
||||
}
|
||||
|
||||
// ResultTypes directResults...;
|
||||
auto directResults = fnConv.getDirectSILResults();
|
||||
for (auto result : directResults) {
|
||||
auto ty =
|
||||
fnConv.getSILType(result, IGF.IGM.getMaximalTypeExpansionContext());
|
||||
auto &ti = IGF.getTypeInfoForLowered(ty.getASTType());
|
||||
valTypes.push_back(ty);
|
||||
typeInfos.push_back(&ti);
|
||||
directReturnInfos.push_back(result);
|
||||
}
|
||||
|
||||
return AsyncContextLayout(
|
||||
IGF.IGM, LayoutStrategy::Optimal, valTypes, typeInfos, IGF, originalType,
|
||||
substitutedType, substitutionMap, std::move(bindings),
|
||||
|
||||
Reference in New Issue
Block a user