Merge pull request #64058 from jckarter/minimize-abi-effect-of-parameter-modifiers-b

Only mangle `borrowing`/`consuming` when they would change ABI.
This commit is contained in:
Joe Groff
2023-03-03 07:01:50 -08:00
committed by GitHub
16 changed files with 281 additions and 138 deletions

View File

@@ -3201,8 +3201,8 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
// we've already ensured that the destination function is not
// @differentiable.
auto flags = param.getParameterFlags();
flags = flags.withValueOwnership(
param.isInOut() ? ValueOwnership::InOut : ValueOwnership::Default);
flags = flags.withOwnershipSpecifier(
param.isInOut() ? ParamSpecifier::InOut : ParamSpecifier::Default);
flags = flags.withNonEphemeral(false)
.withNoDerivative(false);
if (!flags.isNone())