@@ -122,10 +122,26 @@ public enum ArgumentConvention {
122
122
/// guarantees its validity for the entirety of the call.
123
123
case directGuaranteed
124
124
125
+ /// This argument is a value pack of mutable references to storage,
126
+ /// which the function is being given exclusive access to. The elements
127
+ /// must be passed indirectly.
128
+ case packInout
129
+
130
+ /// This argument is a value pack, and ownership of the elements is being
131
+ /// transferred into this function. Whether the elements are passed
132
+ /// indirectly is recorded in the pack type.
133
+ case packOwned
134
+
135
+ /// This argument is a value pack, and ownership of the elements is not
136
+ /// being transferred into this function. Whether the elements are passed
137
+ /// indirectly is recorded in the pack type.
138
+ case packGuaranteed
139
+
125
140
public var isIndirect : Bool {
126
141
switch self {
127
142
case . indirectIn, . indirectInGuaranteed,
128
- . indirectInout, . indirectInoutAliasable, . indirectOut:
143
+ . indirectInout, . indirectInoutAliasable, . indirectOut,
144
+ . packInout, . packOwned, . packGuaranteed:
129
145
return true
130
146
case . directOwned, . directUnowned, . directGuaranteed:
131
147
return false
@@ -134,20 +150,23 @@ public enum ArgumentConvention {
134
150
135
151
public var isIndirectIn : Bool {
136
152
switch self {
137
- case . indirectIn, . indirectInGuaranteed:
153
+ case . indirectIn, . indirectInGuaranteed,
154
+ . packOwned, . packGuaranteed:
138
155
return true
139
156
case . directOwned, . directUnowned, . directGuaranteed,
140
- . indirectInout, . indirectInoutAliasable, . indirectOut:
157
+ . indirectInout, . indirectInoutAliasable, . indirectOut,
158
+ . packInout:
141
159
return false
142
160
}
143
161
}
144
162
145
163
public var isGuaranteed : Bool {
146
164
switch self {
147
- case . indirectInGuaranteed, . directGuaranteed:
165
+ case . indirectInGuaranteed, . directGuaranteed, . packGuaranteed :
148
166
return true
149
167
case . indirectIn, . directOwned, . directUnowned,
150
- . indirectInout, . indirectInoutAliasable, . indirectOut:
168
+ . indirectInout, . indirectInoutAliasable, . indirectOut,
169
+ . packInout, . packOwned:
151
170
return false
152
171
}
153
172
}
@@ -157,7 +176,10 @@ public enum ArgumentConvention {
157
176
case . indirectIn,
158
177
. indirectOut,
159
178
. indirectInGuaranteed,
160
- . indirectInout:
179
+ . indirectInout,
180
+ . packInout,
181
+ . packOwned,
182
+ . packGuaranteed:
161
183
return true
162
184
163
185
case . indirectInoutAliasable,
@@ -171,15 +193,18 @@ public enum ArgumentConvention {
171
193
public var isInout : Bool {
172
194
switch self {
173
195
case . indirectInout,
174
- . indirectInoutAliasable:
196
+ . indirectInoutAliasable,
197
+ . packInout:
175
198
return true
176
199
177
200
case . indirectIn,
178
201
. indirectOut,
179
202
. indirectInGuaranteed,
180
203
. directUnowned,
181
204
. directGuaranteed,
182
- . directOwned:
205
+ . directOwned,
206
+ . packOwned,
207
+ . packGuaranteed:
183
208
return false
184
209
}
185
210
}
@@ -204,6 +229,9 @@ extension BridgedArgumentConvention {
204
229
case . Direct_Owned: return . directOwned
205
230
case . Direct_Unowned: return . directUnowned
206
231
case . Direct_Guaranteed: return . directGuaranteed
232
+ case . Pack_Inout: return . packInout
233
+ case . Pack_Owned: return . packOwned
234
+ case . Pack_Guaranteed: return . packGuaranteed
207
235
default :
208
236
fatalError ( " unsupported argument convention " )
209
237
}
0 commit comments