Skip to content

Commit 4d6a47f

Browse files
committed
Fix isConsumedParameter, etc.
1 parent 242ee1b commit 4d6a47f

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
@@ -4133,11 +4133,11 @@ template <bool InCallee>
41334133
bool isConsumedParameter(ParameterConvention conv) {
41344134
switch (conv) {
41354135
case ParameterConvention::Indirect_In:
4136-
case ParameterConvention::Indirect_In_CXX:
41374136
case ParameterConvention::Direct_Owned:
41384137
case ParameterConvention::Pack_Owned:
41394138
return true;
4140-
4139+
case ParameterConvention::Indirect_In_CXX:
4140+
return !InCallee;
41414141
case ParameterConvention::Indirect_Inout:
41424142
case ParameterConvention::Indirect_InoutAliasable:
41434143
case ParameterConvention::Direct_Unowned:
@@ -4168,10 +4168,10 @@ bool isGuaranteedParameter(ParameterConvention conv) {
41684168
case ParameterConvention::Indirect_In_Guaranteed:
41694169
case ParameterConvention::Pack_Guaranteed:
41704170
return true;
4171-
4171+
case ParameterConvention::Indirect_In_CXX:
4172+
return InCallee;
41724173
case ParameterConvention::Indirect_Inout:
41734174
case ParameterConvention::Indirect_InoutAliasable:
4174-
case ParameterConvention::Indirect_In_CXX:
41754175
case ParameterConvention::Indirect_In:
41764176
case ParameterConvention::Direct_Unowned:
41774177
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)