File tree 1 file changed +10
-17
lines changed
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 {
2044
2044
2045
2045
AbstractionPattern::CallingConventionKind
2046
2046
AbstractionPattern::getErrorConvention (TypeConverter &TC) const {
2047
- // Tuples should be destructured.
2048
- if (isTuple ()) {
2049
- return Destructured;
2050
- }
2051
2047
switch (getKind ()) {
2052
2048
case Kind::Opaque:
2053
2049
// Maximally abstracted values are always thrown indirectly.
2054
2050
return Indirect;
2055
2051
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:
2056
2062
case Kind::OpaqueFunction:
2057
2063
case Kind::OpaqueDerivativeFunction:
2058
2064
case Kind::PartialCurriedObjCMethodType:
@@ -2064,20 +2070,7 @@ AbstractionPattern::getErrorConvention(TypeConverter &TC) const {
2064
2070
case Kind::CXXMethodType:
2065
2071
case Kind::CurriedCXXMethodType:
2066
2072
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
-
2079
2073
case Kind::Invalid:
2080
- case Kind::Tuple:
2081
2074
case Kind::ObjCCompletionHandlerArgumentsType:
2082
2075
llvm_unreachable (" should not get here" );
2083
2076
}
You can’t perform that action at this time.
0 commit comments