Add a new parameter convention @in_cxx for non-trivial C++ classes that are passed indirectly and destructed by the caller (#73019)

This corresponds to the parameter-passing convention of the Itanium C++
ABI, in which the argument is passed indirectly and possibly modified,
but not destroyed, by the callee.

@in_cxx is handled the same way as @in in callers and @in_guaranteed in
callees. OwnershipModelEliminator emits the call to destroy_addr that is
needed to destroy the argument in the caller.

rdar://122707697
This commit is contained in:
Akira Hatanaka
2024-06-27 09:44:04 -07:00
committed by GitHub
parent 9d6e36b512
commit 42bc49d3fe
64 changed files with 739 additions and 48 deletions

View File

@@ -610,6 +610,7 @@ inline bool SILModuleConventions::isIndirectSILParam(SILParameterInfo param,
case ParameterConvention::Indirect_In:
case ParameterConvention::Indirect_In_Guaranteed:
case ParameterConvention::Indirect_In_CXX:
return isTypeIndirectForIndirectParamConvention(param.getInterfaceType(),
loweredAddresses);
case ParameterConvention::Indirect_Inout: