mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Create two versions (for caller and callee) of the functions that answer questions about parameter convention (#74124)
Create two versions of the following functions: isConsumedParameter isGuaranteedParameter SILParameterInfo::isConsumed SILParameterInfo::isGuaranteed SILArgumentConvention::isOwnedConvention SILArgumentConvention::isGuaranteedConvention These changes will be needed when we add a new convention for non-trivial C++ types as the functions will return different answers depending on whether they are called for the caller or the callee. This commit doesn't change any functionality.
This commit is contained in:
@@ -1269,12 +1269,12 @@ void DeclAndTypeClangFunctionPrinter::printCxxThunkBody(
|
||||
signature.visitParameterList(
|
||||
[&](const LoweredFunctionSignature::IndirectResultValue &) {},
|
||||
[&](const LoweredFunctionSignature::DirectParameter ¶m) {
|
||||
if (isConsumedParameter(param.getConvention()))
|
||||
if (isConsumedParameterInCaller(param.getConvention()))
|
||||
emitParamCopyForConsume(param.getParamDecl());
|
||||
++paramIndex;
|
||||
},
|
||||
[&](const LoweredFunctionSignature::IndirectParameter ¶m) {
|
||||
if (isConsumedParameter(param.getConvention()))
|
||||
if (isConsumedParameterInCaller(param.getConvention()))
|
||||
emitParamCopyForConsume(param.getParamDecl());
|
||||
++paramIndex;
|
||||
},
|
||||
@@ -1338,12 +1338,12 @@ void DeclAndTypeClangFunctionPrinter::printCxxThunkBody(
|
||||
},
|
||||
[&](const LoweredFunctionSignature::DirectParameter ¶m) {
|
||||
printParamUse(param.getParamDecl(), /*isIndirect=*/false,
|
||||
isConsumedParameter(param.getConvention()),
|
||||
isConsumedParameterInCaller(param.getConvention()),
|
||||
encodeTypeInfo(param, moduleContext, typeMapping));
|
||||
},
|
||||
[&](const LoweredFunctionSignature::IndirectParameter ¶m) {
|
||||
printParamUse(param.getParamDecl(), /*isIndirect=*/true,
|
||||
isConsumedParameter(param.getConvention()),
|
||||
isConsumedParameterInCaller(param.getConvention()),
|
||||
/*directTypeEncoding=*/"");
|
||||
},
|
||||
[&](const LoweredFunctionSignature::GenericRequirementParameter
|
||||
|
||||
Reference in New Issue
Block a user