File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed
Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -2044,15 +2044,21 @@ AbstractionPattern::getParameterConvention(TypeConverter &TC) const {
20442044
20452045AbstractionPattern::CallingConventionKind
20462046AbstractionPattern::getErrorConvention (TypeConverter &TC) const {
2047- // Tuples should be destructured.
2048- if (isTuple ()) {
2049- return Destructured;
2050- }
20512047 switch (getKind ()) {
20522048 case Kind::Opaque:
20532049 // Maximally abstracted values are always thrown indirectly.
20542050 return Indirect;
20552051
2052+ case Kind::ClangType:
2053+ case Kind::Type:
2054+ case Kind::Discard:
2055+ // Pass according to the formal type.
2056+ return SILType::isFormallyThrownIndirectly (getType (),
2057+ TC,
2058+ getGenericSignatureOrNull ())
2059+ ? Indirect : Direct;
2060+
2061+ case Kind::Tuple:
20562062 case Kind::OpaqueFunction:
20572063 case Kind::OpaqueDerivativeFunction:
20582064 case Kind::PartialCurriedObjCMethodType:
@@ -2064,20 +2070,7 @@ AbstractionPattern::getErrorConvention(TypeConverter &TC) const {
20642070 case Kind::CXXMethodType:
20652071 case Kind::CurriedCXXMethodType:
20662072 case Kind::PartialCurriedCXXMethodType:
2067- // Function types are always thrown directly
2068- return Direct;
2069-
2070- case Kind::ClangType:
2071- case Kind::Type:
2072- case Kind::Discard:
2073- // Pass according to the formal type.
2074- return SILType::isFormallyThrownIndirectly (getType (),
2075- TC,
2076- getGenericSignatureOrNull ())
2077- ? Indirect : Direct;
2078-
20792073 case Kind::Invalid:
2080- case Kind::Tuple:
20812074 case Kind::ObjCCompletionHandlerArgumentsType:
20822075 llvm_unreachable (" should not get here" );
20832076 }
You can’t perform that action at this time.
0 commit comments