mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] Fix calling convention for rvalue reference params
In C++, we always expected to invoke the dtor for moved-from objects. This is not the case for swift. Fortunately, @inCxx calling convention is already expressing that the caller supposed to destroy the object. This fixes the missing dtor calls when calling C++ functions taking rvalue references. Fixes #77894. rdar://140786022
This commit is contained in:
@@ -341,6 +341,7 @@ public:
|
||||
case SILArgumentConvention::Indirect_In:
|
||||
return true;
|
||||
case SILArgumentConvention::Indirect_In_Guaranteed:
|
||||
case SILArgumentConvention::Indirect_In_CXX:
|
||||
case SILArgumentConvention::Indirect_Inout:
|
||||
case SILArgumentConvention::Indirect_InoutAliasable:
|
||||
return false;
|
||||
@@ -445,6 +446,7 @@ public:
|
||||
case SILArgumentConvention::Indirect_InoutAliasable:
|
||||
case SILArgumentConvention::Indirect_In_Guaranteed:
|
||||
return false;
|
||||
case SILArgumentConvention::Indirect_In_CXX:
|
||||
case SILArgumentConvention::Indirect_In:
|
||||
llvm_unreachable("copy_addr src destroyed without reinitialization");
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user