@@ -137,11 +137,17 @@ public enum ArgumentConvention {
137137 /// indirectly is recorded in the pack type.
138138 case packGuaranteed
139139
140+ /// This argument is a pack of indirect return value addresses. The
141+ /// addresses are stored in the pack by the caller and read out by the
142+ /// callee; within the callee, they are individually treated like
143+ /// indirectOut arguments.
144+ case packOut
145+
140146 public var isIndirect : Bool {
141147 switch self {
142148 case . indirectIn, . indirectInGuaranteed,
143149 . indirectInout, . indirectInoutAliasable, . indirectOut,
144- . packInout, . packOwned, . packGuaranteed:
150+ . packOut , . packInout, . packOwned, . packGuaranteed:
145151 return true
146152 case . directOwned, . directUnowned, . directGuaranteed:
147153 return false
@@ -155,7 +161,19 @@ public enum ArgumentConvention {
155161 return true
156162 case . directOwned, . directUnowned, . directGuaranteed,
157163 . indirectInout, . indirectInoutAliasable, . indirectOut,
158- . packInout:
164+ . packOut, . packInout:
165+ return false
166+ }
167+ }
168+
169+ public var isIndirectOut : Bool {
170+ switch self {
171+ case . indirectOut, . packOut:
172+ return true
173+ case . indirectInGuaranteed, . directGuaranteed, . packGuaranteed,
174+ . indirectIn, . directOwned, . directUnowned,
175+ . indirectInout, . indirectInoutAliasable,
176+ . packInout, . packOwned:
159177 return false
160178 }
161179 }
@@ -166,7 +184,7 @@ public enum ArgumentConvention {
166184 return true
167185 case . indirectIn, . directOwned, . directUnowned,
168186 . indirectInout, . indirectInoutAliasable, . indirectOut,
169- . packInout, . packOwned:
187+ . packOut , . packInout, . packOwned:
170188 return false
171189 }
172190 }
@@ -177,6 +195,7 @@ public enum ArgumentConvention {
177195 . indirectOut,
178196 . indirectInGuaranteed,
179197 . indirectInout,
198+ . packOut,
180199 . packInout,
181200 . packOwned,
182201 . packGuaranteed:
@@ -203,6 +222,7 @@ public enum ArgumentConvention {
203222 . directUnowned,
204223 . directGuaranteed,
205224 . directOwned,
225+ . packOut,
206226 . packOwned,
207227 . packGuaranteed:
208228 return false
@@ -229,6 +249,7 @@ extension BridgedArgumentConvention {
229249 case . Direct_Owned: return . directOwned
230250 case . Direct_Unowned: return . directUnowned
231251 case . Direct_Guaranteed: return . directGuaranteed
252+ case . Pack_Out: return . packOut
232253 case . Pack_Inout: return . packInout
233254 case . Pack_Owned: return . packOwned
234255 case . Pack_Guaranteed: return . packGuaranteed
0 commit comments