@@ -122,10 +122,26 @@ public enum ArgumentConvention {
122122 /// guarantees its validity for the entirety of the call.
123123 case directGuaranteed
124124
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+
125140 public var isIndirect : Bool {
126141 switch self {
127142 case . indirectIn, . indirectInGuaranteed,
128- . indirectInout, . indirectInoutAliasable, . indirectOut:
143+ . indirectInout, . indirectInoutAliasable, . indirectOut,
144+ . packInout, . packOwned, . packGuaranteed:
129145 return true
130146 case . directOwned, . directUnowned, . directGuaranteed:
131147 return false
@@ -134,20 +150,23 @@ public enum ArgumentConvention {
134150
135151 public var isIndirectIn : Bool {
136152 switch self {
137- case . indirectIn, . indirectInGuaranteed:
153+ case . indirectIn, . indirectInGuaranteed,
154+ . packOwned, . packGuaranteed:
138155 return true
139156 case . directOwned, . directUnowned, . directGuaranteed,
140- . indirectInout, . indirectInoutAliasable, . indirectOut:
157+ . indirectInout, . indirectInoutAliasable, . indirectOut,
158+ . packInout:
141159 return false
142160 }
143161 }
144162
145163 public var isGuaranteed : Bool {
146164 switch self {
147- case . indirectInGuaranteed, . directGuaranteed:
165+ case . indirectInGuaranteed, . directGuaranteed, . packGuaranteed :
148166 return true
149167 case . indirectIn, . directOwned, . directUnowned,
150- . indirectInout, . indirectInoutAliasable, . indirectOut:
168+ . indirectInout, . indirectInoutAliasable, . indirectOut,
169+ . packInout, . packOwned:
151170 return false
152171 }
153172 }
@@ -157,7 +176,10 @@ public enum ArgumentConvention {
157176 case . indirectIn,
158177 . indirectOut,
159178 . indirectInGuaranteed,
160- . indirectInout:
179+ . indirectInout,
180+ . packInout,
181+ . packOwned,
182+ . packGuaranteed:
161183 return true
162184
163185 case . indirectInoutAliasable,
@@ -171,15 +193,18 @@ public enum ArgumentConvention {
171193 public var isInout : Bool {
172194 switch self {
173195 case . indirectInout,
174- . indirectInoutAliasable:
196+ . indirectInoutAliasable,
197+ . packInout:
175198 return true
176199
177200 case . indirectIn,
178201 . indirectOut,
179202 . indirectInGuaranteed,
180203 . directUnowned,
181204 . directGuaranteed,
182- . directOwned:
205+ . directOwned,
206+ . packOwned,
207+ . packGuaranteed:
183208 return false
184209 }
185210 }
@@ -204,6 +229,9 @@ extension BridgedArgumentConvention {
204229 case . Direct_Owned: return . directOwned
205230 case . Direct_Unowned: return . directUnowned
206231 case . Direct_Guaranteed: return . directGuaranteed
232+ case . Pack_Inout: return . packInout
233+ case . Pack_Owned: return . packOwned
234+ case . Pack_Guaranteed: return . packGuaranteed
207235 default :
208236 fatalError ( " unsupported argument convention " )
209237 }
0 commit comments