Skip to content

Commit e890ce6

Browse files
committed
Fix isConsumedParameter, etc.
1 parent 8cc4b6f commit e890ce6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

include/swift/AST/Types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4129,11 +4129,11 @@ template <bool InCallee>
41294129
bool isConsumedParameter(ParameterConvention conv) {
41304130
switch (conv) {
41314131
case ParameterConvention::Indirect_In:
4132-
case ParameterConvention::Indirect_In_CXX:
41334132
case ParameterConvention::Direct_Owned:
41344133
case ParameterConvention::Pack_Owned:
41354134
return true;
4136-
4135+
case ParameterConvention::Indirect_In_CXX:
4136+
return !InCallee;
41374137
case ParameterConvention::Indirect_Inout:
41384138
case ParameterConvention::Indirect_InoutAliasable:
41394139
case ParameterConvention::Direct_Unowned:
@@ -4164,10 +4164,10 @@ bool isGuaranteedParameter(ParameterConvention conv) {
41644164
case ParameterConvention::Indirect_In_Guaranteed:
41654165
case ParameterConvention::Pack_Guaranteed:
41664166
return true;
4167-
4167+
case ParameterConvention::Indirect_In_CXX:
4168+
return InCallee;
41684169
case ParameterConvention::Indirect_Inout:
41694170
case ParameterConvention::Indirect_InoutAliasable:
4170-
case ParameterConvention::Indirect_In_CXX:
41714171
case ParameterConvention::Indirect_In:
41724172
case ParameterConvention::Direct_Unowned:
41734173
case ParameterConvention::Direct_Owned:

include/swift/SIL/SILArgumentConvention.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ struct SILArgumentConvention {
115115
case SILArgumentConvention::Direct_Owned:
116116
case SILArgumentConvention::Pack_Owned:
117117
return true;
118-
case SILArgumentConvention::Indirect_In_Guaranteed:
119118
case SILArgumentConvention::Indirect_In_CXX:
119+
return !InCallee;
120+
case SILArgumentConvention::Indirect_In_Guaranteed:
120121
case SILArgumentConvention::Direct_Guaranteed:
121122
case SILArgumentConvention::Indirect_Inout:
122123
case SILArgumentConvention::Indirect_Out:
@@ -138,10 +139,11 @@ struct SILArgumentConvention {
138139
bool isGuaranteedConvention() const {
139140
switch (Value) {
140141
case SILArgumentConvention::Indirect_In_Guaranteed:
141-
case SILArgumentConvention::Indirect_In_CXX:
142142
case SILArgumentConvention::Direct_Guaranteed:
143143
case SILArgumentConvention::Pack_Guaranteed:
144144
return true;
145+
case SILArgumentConvention::Indirect_In_CXX:
146+
return InCallee;
145147
case SILArgumentConvention::Indirect_Inout:
146148
case SILArgumentConvention::Indirect_In:
147149
case SILArgumentConvention::Indirect_Out:

0 commit comments

Comments
 (0)